// Copyright (C) 2012 by Tobias Bengfort 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); };