// Copyright (C) 2012 by Tobias Bengfort // working for Free Software Foundation Europe // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . function map_init(mapID, lat, lng) { //create a map object var map = new L.Map(mapID); //create a base layer for tiles var osmLayer = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'); //add base layer to map map.addLayer(osmLayer); //set center of the map map.setView(new L.LatLng(lat, lng), 5); //set attribution map.attributionControl.addAttribution('map data under CC-BY-SA by OpenStreetMap'); // display place marker marker = new L.Marker(new L.LatLng(lat, lng)); map.addLayer(marker); };