API style geo.admin.ch

CatalogTree

by loleg

HTML

<link rel="stylesheet" href="http://www.openlayers.org/dev/theme/default/style.css">
<link rel="stylesheet" href="http://www.openlayers.org/dev/examples/style.css">
<script src="http://api.geo.admin.ch/loader.js"></script>
 <h1>Map with GeoAdmin API</h1>

<div id="catalogtree" style="float: left; width:320px;height:340px;border:1px solid grey;padding: 0 0 0 0;margin:10px !important;"></div>
<div id="map" style="float:right; width:300px;height:300px;border:1px solid grey;padding: 0 0 0 0;margin:10px !important;"></div>

JavaScript

// API style
// note: default map is the pixelfarbe
var params=OpenLayers.Util.getParameters();

var geo = new GeoAdmin.API({
    lang: params.lang || "fr"
});
geo.createMap({
    div: "map",
    bgLayer: 'ch.swisstopo.pixelkarte-grau',
    zoom: 0
});
var tree = new GeoAdmin.CatalogTree({renderTo: "catalogtree", map: geo.map});