Table Of Contents

Previous topic

API Widgets Examples

Next topic

Layer Tree

This Page

Default Map

Hide code
<script type="text/javascript">
   function init() {
      var map1 = new GeoAdmin.Map("mymap1", {doZoomToMaxExtent: true});
   }
</script>
<body onload="init();">
  <div id="mymap1" style="width:500px;height:340px;border:1px solid grey;padding: 0 0 0 0;margin:10px !important;"></div>
  <script type="text/javascript" src="https://api.geo.admin.ch/loader.js"></script>
</body>

Map with gray pixelmap and overlay layer

Hide code
<script type="text/javascript">
   function init() {
      var map2 = new GeoAdmin.Map("mymap2", {doZoomToMaxExtent: true});
      map2.switchComplementaryLayer("ch.swisstopo.pixelkarte-grau", {opacity: 1});
      map2.addLayerByName("ch.swisstopo.swissboundaries3d-kanton-flaeche.fill");
   }
</script>
<body onload="init();">
  <div id="mymap2" style="width:500px;height:340px;border:1px solid grey;padding: 0 0 0 0;margin:10px !important;"></div>
  <script type="text/javascript" src="https://api.geo.admin.ch/loader.js"></script>
</body>

Base Layer Tool

Hide code
<script type="text/javascript">
   function init() {
      var map3 = new GeoAdmin.Map("mymap3", {doZoomToMaxExtent: true});
      map3.switchComplementaryLayer("ch.swisstopo.pixelkarte-farbe", {opacity: 1});
      var baseLayerTool = new GeoAdmin.BaseLayerTool({
         renderTo: "baselayertool3",
         map: map3
      });
   }
</script>
<body onload="init();">
  <div id="baselayertool3"></div>
  <div id="mymap3" style="width:500px;height:340px;border:1px solid grey;padding: 0 0 0 0;margin:10px !important;"></div>
  <script type="text/javascript" src="https://api.geo.admin.ch/loader.js"></script>
</body>