Table Of Contents

Previous topic

Layer Tree

Next topic

Aggregate layer

This Page

BOD Search Window

Open the metadata for layer ch.swisstopo.fixpunkte-agnes
Hide code
<body">
  <a href="javascript:GeoAdmin.BodSearchWindow.show('ch.swisstopo.fixpunkte-agnes');" style="padding: 0 0 0 0;margin:10px !important;">Open the metadata for layer ch.swisstopo.fixpunkte-agnes</a>
</body>

Print

A Map Panel is required in order to add a toolbar with the print function. In this example, the “Popup” print contains all possible configuration. The “Panel” print is the default configuration. A custom title, footer and logo (we recommend to use a 516x70 px logo) can be defined. It can be chosen to show the legend on a second page or not.

Hide code
<script type="text/javascript">
   function init() {
      var mapPanel2 = new GeoAdmin.MapPanel({
         renderTo: "mymap2",
         width: 500,
         height: 340,
         map: new GeoAdmin.Map(),
         stateId: "map",
         tbar: ["->"
         ]
     });
     mapPanel2.map.addLayerByName('ch.bafu.wasser-entnahme');
     mapPanel2.getTopToolbar().add([
         new GeoAdmin.Print({
             configureTitle: true,
             configureFooter: true,
             configureLegend: true,
             mapLogo: "http://www.dummy.com/myimage.png",
             mapTitle: "My custom title",
             mapFooter: "This is a custom footer.",
             text: OpenLayers.i18n('print map (popup)'),
             printPanelOptions: {
                 mapPanel: mapPanel2
             },
             windowOptions: {
                 height: 300,
                 title: OpenLayers.i18n('print map')
             }
         }),
         new GeoAdmin.Print({
             text: OpenLayers.i18n('print map (panel)'),
             printPanelOptions: {
                 renderTo: 'myprint',
                 mapPanel: mapPanel2
             }
         })
      ]);
   }
</script>
<body onload="init();">
  <div id="myprint" style="margin-left:10px !important;width: 200px;"></div>
  <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>

Context Popup

A context popup provide information on the map right mouse click

Hide code
<script type="text/javascript">
   function init() {
      var map13 = new GeoAdmin.Map("mymap3", {doZoomToMaxExtent: true});
      var contextPopup = new GeoAdmin.ContextPopup({map: map13});
      map13.addControl(contextPopup);
   }
</script>
<body onload="init();">
  <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>

Map Panel

Hide code
<script type="text/javascript">
   function init() {
      var map14 = new GeoAdmin.Map();
      var mappane14 = new GeoAdmin.MapPanel({renderTo: "mymap4", map:map14, width: 500, height:340});
   }
</script>
<body onload="init();">
  <div id="mymap4" 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>