Zum Inhalt

Map Style

In diesem Beispiel wird eine Karte in einem div-Container gezeichnet. Das style-Attribut von ym.map

Hinweis: Diese Funktion ist erst ab Version 3.4 der JS-API verfügbar.

SmartMaps Map

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>SmartMaps Map</title>
</head>
<body>
  <div id="map-wrapper">
    <!-- Predefined div for displaying the map. -->
    <div id="map" style="width: 100%; height: 300px;"></div>
  </div>
  <!-- SmartMaps API -->
  <script src="https://www.yellowmap.de/api_rst/api/loader?libraries=free-3&apiKey=[INSERT API-KEY]"></script>

  <script>
    ym.ready(function(modules) {
      var map = ym.map("map", {
        // Define latitude and longitude.
        center: ym.latLng(49.001, 8.417),
        // Define zoom value.
        zoom: 12,
        // Define map style
        style: 'darkmode'
      });

      window.map = map;
    });
  </script>
</body>
</html>
Ersetzen Sie UiyzEGkdM%2BG8mHu6In3%2FN4YnV7PahFDug8mIud3HzARrYl7Yq%2FTpkgvfSN3XuNq%2F durch Ihren tatsächlichen API-Key, um das Beispiel lokal zu testen.