This page describes how to use the Simple API. The Simple API provides a JavaScript API for inserting simple maps into web pages.
To use the API you should add the following HTML:
<link href="https://mapnv.ch/api.css" rel="stylesheet">
<script src="https://mapnv.ch/api.js?version=2"></script>
<script>
window.onload = function() {
// add the code here
};
</script>
To put a new map in the page you'll have to put a div element with a certain id where you want your map to be:
<div id='map1' style='width:700px;height:400px;'></div>
var map = new mapnv.Map({
div: 'map10',
zoom: 3,
center: [2538181, 1183651],
searchDiv: 'map10search'
});
var map = new mapnv.Map({
div: 'map1', // id of the div element to put the map in
zoom: 4,
center: [2538181, 1183651]
});
var map = new mapnv.Map({
div: 'map2',
zoom: 8,
backgroundLayers: ['Plan-couleur'],
center: [2538181, 1183651]
});
map.addMarker();
var map = new mapnv.Map({
div: 'map4',
zoom: 0,
center: [2538707, 1181061],
layers: ['POI_admin_y_no_maxscaledenom']
});
var map = new mapnv.Map({
div: 'map5',
zoom: 3,
center: [2538181, 1183651],
layers: ['POI_admin_y_no_maxscaledenom'],
addLayerSwitcher: true,
addMiniMap: true,
miniMapExpanded: true,
showCoords: true
});