Google Maps - Snippets: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 3: Zeile 3:
 
  https://www.google.de/maps/dir//Rinckstr.+7-11+D-83435+Bad+Reichenhall
 
  https://www.google.de/maps/dir//Rinckstr.+7-11+D-83435+Bad+Reichenhall
 
Beispiel Button auf Google Karte:
 
Beispiel Button auf Google Karte:
<pre>
+
<syntaxhighlight lang="html5">
 
<div class="gmroute" style="z-index: 30001;position: relative;height: 30px;right: 40px;top: 40px;">
 
<div class="gmroute" style="z-index: 30001;position: relative;height: 30px;right: 40px;top: 40px;">
 
   <a href="https://www.google.de/maps/dir//Am+Herrenberg+7-9+D-86932+Pürgen" target="_blank"  style="background-color: #5B5B5B;color:white; border: 1px solid #777;float: right;padding: 8px;">
 
   <a href="https://www.google.de/maps/dir//Am+Herrenberg+7-9+D-86932+Pürgen" target="_blank"  style="background-color: #5B5B5B;color:white; border: 1px solid #777;float: right;padding: 8px;">
Zeile 9: Zeile 9:
 
     </a>
 
     </a>
 
</div>
 
</div>
</pre>
+
</syntaxhighlight>
  
 
== Einfache Karte ==
 
== Einfache Karte ==

Version vom 20. Januar 2016, 11:32 Uhr

Link auf Google Maps Routenplaner

Beispiel einfacher Link:

https://www.google.de/maps/dir//Rinckstr.+7-11+D-83435+Bad+Reichenhall

Beispiel Button auf Google Karte:

<div class="gmroute" style="z-index: 30001;position: relative;height: 30px;right: 40px;top: 40px;">
  <a href="https://www.google.de/maps/dir//Am+Herrenberg+7-9+D-86932+Pürgen" target="_blank"  style="background-color: #5B5B5B;color:white; border: 1px solid #777;float: right;padding: 8px;">
    Route mit Google Maps planen.
    </a>
</div>

Einfache Karte

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
    <script>
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>