Skip to content

Commit e76a341

Browse files
committed
Update Leaflet to version 0.4.4
git-svn-id: https://share-extras.googlecode.com/svn/trunk/Document Geographic Details@1281 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
1 parent 4009973 commit e76a341

File tree

6 files changed

+202
-211
lines changed

6 files changed

+202
-211
lines changed

web/extras/components/geographic/osm-map.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,17 @@ if (typeof Extras.component == "undefined" || !Extras.component)
192192
else if (this.options.mapType == "leaflet" && typeof L == "object")
193193
{
194194
// set up the map
195-
var map = new L.Map(this.id + "-map");
195+
var map = new L.Map(this.id + "-map").setView([properties["cm:latitude"], properties["cm:longitude"]], this.options.mapInitialZoom);
196196

197197
// create the tile layer with correct attribution
198-
var osm = new L.TileLayer(this.options.leafletTileUrl, {attribution: this.msg("label.copyright.osm")});
199-
var latlng = new L.LatLng(properties["cm:latitude"], properties["cm:longitude"]);
200-
201-
// start the map centred on the icon
202-
map.setView(latlng, this.options.mapInitialZoom);
203-
map.addLayer(osm);
198+
L.tileLayer(this.options.leafletTileUrl, {
199+
attribution: this.msg("label.copyright.osm")
200+
}).addTo(map);
204201

205202
// create a marker in the given location and add it to the map
203+
L.marker([properties["cm:latitude"], properties["cm:longitude"]]).addTo(map)
204+
.bindPopup(Dom.get(this.id + "-info").innerHTML).openPopup();
206205
var marker = new L.Marker(latlng);
207-
map.addLayer(marker);
208-
209-
// attach a given HTML content to the marker and immediately open it
210-
marker.bindPopup(Dom.get(this.id + "-info").innerHTML, {}).openPopup();
211206
}
212207
else
213208
{
3.85 KB
Loading
2.46 KB
Loading

0 commit comments

Comments
 (0)