Save map view in location hash

pull/54/merge
Candid Dauth 2016-10-14 12:14:48 +03:00
rodzic 190053453b
commit 6a942165ca
3 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

@ -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;
}
});

Wyświetl plik

@ -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": {