projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7606d13
)
Only record a visible object if it exists
author
Tom Hughes
<tom@compton.nu>
Wed, 8 Feb 2017 09:53:30 +0000
(09:53 +0000)
committer
Tom Hughes
<tom@compton.nu>
Wed, 8 Feb 2017 09:54:14 +0000
(09:54 +0000)
Fixes #1430
app/assets/javascripts/leaflet.map.js
patch
|
blob
|
history
diff --git
a/app/assets/javascripts/leaflet.map.js
b/app/assets/javascripts/leaflet.map.js
index 380955c363fcd2b06b75bb04180ef8218f221b7b..4b50cc78c4ca0660b3ff5cfe484b95a53e417b94 100644
(file)
--- a/
app/assets/javascripts/leaflet.map.js
+++ b/
app/assets/javascripts/leaflet.map.js
@@
-211,16
+211,15
@@
L.OSM.Map = L.Map.extend({
clickable: false
};
- this._object = object;
-
- if (this._objectLoader) this._objectLoader.abort();
- if (this._objectLayer) this.removeLayer(this._objectLayer);
+ this.removeObject();
var map = this;
this._objectLoader = $.ajax({
url: OSM.apiUrl(object),
dataType: "xml",
success: function (xml) {
+ map._object = object;
+
map._objectLayer = new L.OSM.DataLayer(null, {
styles: {
node: objectStyle,