Google Maps - Snippets: Unterschied zwischen den Versionen
Aus Wikizone
(Die Seite wurde neu angelegt: „ == Zusätzliche Google Maps Libraries einbinden == Beispiel: <pre> <script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=drawing,places"></…“) |
|||
| Zeile 1: | Zeile 1: | ||
| + | == Einfache Karte == | ||
| + | <pre> | ||
| + | <!DOCTYPE html> | ||
| + | <head> | ||
| + | <meta charset="utf-8"> | ||
| + | <meta content='IE=8' http-equiv='X-UA-Compatible'> | ||
| + | <title></title> | ||
| + | <meta name="viewport" content="width=device-width"> | ||
| + | <style> | ||
| + | html, body, #map-canvas { | ||
| + | height: 100%; | ||
| + | margin: 0px; | ||
| + | padding: 0px | ||
| + | } | ||
| + | </style> | ||
| + | <script src="https://maps.googleapis.com/maps/api/js?v=3.9"></script> | ||
| + | <script type="text/javascript"> | ||
| + | var map; | ||
| + | function initialize() { | ||
| + | var mapOptions = { | ||
| + | zoom: 8, | ||
| + | center: new google.maps.LatLng(-34.397, 150.644) | ||
| + | }; | ||
| + | map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); | ||
| + | } | ||
| + | |||
| + | google.maps.event.addDomListener(window, 'load', initialize); | ||
| + | </script> | ||
| + | </head> | ||
| + | <body> | ||
| + | <div id="map-canvas"></div> | ||
| + | </body> | ||
| + | </html> | ||
| + | </pre> | ||
== Zusätzliche Google Maps Libraries einbinden == | == Zusätzliche Google Maps Libraries einbinden == | ||
Version vom 3. November 2014, 12:08 Uhr
Einfache Karte
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta content='IE=8' http-equiv='X-UA-Compatible'>
<title></title>
<meta name="viewport" content="width=device-width">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.9"></script>
<script type="text/javascript">
var map;
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644)
};
map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
Zusätzliche Google Maps Libraries einbinden
Beispiel:
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=drawing,places"></script>