File tree Expand file tree Collapse file tree 6 files changed +202
-211
lines changed Expand file tree Collapse file tree 6 files changed +202
-211
lines changed Original file line number Diff line number Diff line change @@ -192,22 +192,17 @@ if (typeof Extras.component == "undefined" || !Extras.component)
192
192
else if ( this . options . mapType == "leaflet" && typeof L == "object" )
193
193
{
194
194
// 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 ) ;
196
196
197
197
// 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 ) ;
204
201
205
202
// 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 ( ) ;
206
205
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 ( ) ;
211
206
}
212
207
else
213
208
{
You can’t perform that action at this time.
0 commit comments