Skip to content

Commit d5ca37c

Browse files
committed
Adds map view listener
1 parent abbcbac commit d5ca37c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

assets/javascripts/app.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ var App = (function ($, publ) {
193193

194194
// Add LayerSwitcher Image Toolbar
195195
map.addControl(new ol.control.LayerPopup());
196+
197+
// Add map events
198+
map.on('moveend', publ.updateFilter);
196199
};
197200

198201
/**
@@ -343,6 +346,16 @@ var App = (function ($, publ) {
343346
}
344347
};
345348

349+
/**
350+
* Updates map settings for Redmine filter
351+
*/
352+
publ.updateFilter = function () {
353+
var center = map.getView().getCenter();
354+
var extent = map.getView().calculateExtent(map.getSize());
355+
console.log("Map Center (WGS84): ", ol.proj.transform(center,'EPSG:3857','EPSG:4326'));
356+
console.log("Map Extent (WGS84): ", ol.proj.transformExtent(extent,'EPSG:3857','EPSG:4326'));
357+
}
358+
346359
/**
347360
* Parse page for WKT strings in history
348361
*/

0 commit comments

Comments
 (0)