aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-03-12 16:52:44 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-13 16:46:33 +0000
commit3cd4bb6e70d193f678e482835688f53c6ec68632 (patch)
tree4f4eabd2fce57d19de71aa8f34d64c2aa3be0510 /web/js/map-OpenLayers.js
parent77d9804e958be13d7995d130fd6e4cfda2527a03 (diff)
Update some tight JS coupling to use events.
Remove 'hooks' functions, and Split out USRN handling to its own object.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 5ebb9a18e..0a1c947a0 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -59,12 +59,7 @@ $.extend(fixmystreet.utils, {
document.getElementById('fixmystreet.latitude').value = lat;
document.getElementById('fixmystreet.longitude').value = lon;
- // This tight coupling isn't ideal. A better solution would be for the
- // asset code to register an event handler somewhere, but the correct
- // place isn't apparent.
- if (fixmystreet.assets) {
- fixmystreet.assets.select_usrn(lonlat);
- }
+ $(fixmystreet).trigger('maps:update_pin', [ lonlat ]);
return {
'url': { 'lon': lon, 'lat': lat },