kopia lustrzana https://github.com/FacilMap/facilmap
Save map view in location hash
rodzic
190053453b
commit
6a942165ca
|
@ -90,7 +90,7 @@ var FacilPad = {
|
|||
|
||||
map.socket.$watch("padId", function(padId) {
|
||||
if(padId)
|
||||
history.replaceState(null, "", $scope.urlPrefix + padId);
|
||||
history.replaceState(null, "", $scope.urlPrefix + padId + location.hash);
|
||||
});
|
||||
}, 0);
|
||||
|
||||
|
|
|
@ -106,6 +106,8 @@
|
|||
iconLoading: "glyphicon glyphicon-screenshot"
|
||||
}).addTo(map.map);
|
||||
|
||||
L.hash(map.map, map.layers);
|
||||
|
||||
map.map.on('almost:over', function(e) {
|
||||
e.layer.fire('fp-almostover', e);
|
||||
$(map.map.getContainer()).addClass("fp-almostover");
|
||||
|
@ -275,7 +277,10 @@
|
|||
var loadedWatcher = map.socket.$watch("padData", function(padData) {
|
||||
if(padData != null) {
|
||||
loadedWatcher();
|
||||
map.displayView(padData.defaultView);
|
||||
|
||||
if(!map.map._loaded) // hash control might have set a location already
|
||||
map.displayView(padData.defaultView);
|
||||
|
||||
scope.loaded = true;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
"leaflet.locatecontrol": "^0.55.0",
|
||||
"clipboard": "^1.5.12",
|
||||
"togeojson": "https://github.com/mapbox/togeojson/raw/master/togeojson.js",
|
||||
"osmtogeojson": "^2.2.12"
|
||||
"osmtogeojson": "^2.2.12",
|
||||
"leaflet-fullHash": "https://raw.githubusercontent.com/KoGor/leaflet-fullHash/master/leaflet-fullHash.js"
|
||||
},
|
||||
"overrides": {
|
||||
"bootstrap": {
|
||||
|
|
Ładowanie…
Reference in New Issue