aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-07-06 19:43:59 +0200
committerMarius Halden <marius.h@lden.org>2016-07-06 19:43:59 +0200
commit26ef9e161e7ca4bbcf6bcbddb1ba4f215bc349ec (patch)
treea6a4d1019a38e99c7492416af91eb8cb5a90c6db /web/js/map-OpenLayers.js
parent2e7086d04d1ea729bf898acc0cae6835518bc106 (diff)
parent370067141211acde05766fcaa3bfad0f8b232750 (diff)
Merge tag 'v1.8.4' into fiksgatami-devfiksgatami-dev-1.8
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 267643898..d1dba631e 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -646,6 +646,17 @@ OpenLayers.Protocol.FixMyStreet = OpenLayers.Class(OpenLayers.Protocol.HTTP, {
/* Pan data handler */
OpenLayers.Format.FixMyStreet = OpenLayers.Class(OpenLayers.Format.JSON, {
read: function(json, filter) {
+ // Check we haven't received the data after the map has been clicked.
+ if (fixmystreet.page == 'new') {
+ // If we have, we want to do nothing, which means returning an
+ // array of the back-projected version of the current pin
+ var pin = fixmystreet.markers.features[0].clone();
+ pin.geometry.transform(
+ fixmystreet.map.getProjectionObject(),
+ new OpenLayers.Projection("EPSG:4326")
+ );
+ return [ pin ];
+ }
if (typeof json == 'string') {
obj = OpenLayers.Format.JSON.prototype.read.apply(this, [json, filter]);
} else {