aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-07-06 19:53:50 +0200
committerMarius Halden <marius.h@lden.org>2016-07-06 19:53:50 +0200
commit02edc2af388e8e77c6da876bcec3633ea9161083 (patch)
tree59e65ccfc88c0795476db7ae709013862c7161c3 /web/js/map-OpenLayers.js
parent2cf7f0dcf146143613beb102d0dd227238776b69 (diff)
parent26ef9e161e7ca4bbcf6bcbddb1ba4f215bc349ec (diff)
Oppgrader til 1.8.4fiksgatami-prod-1.8
Merge branch 'fiksgatami-dev' into fiksgatami-prod
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 {