From 4bf26ef9e6159a3624bfe3a307c869de1b7003d0 Mon Sep 17 00:00:00 2001 From: Thomas Haddad Date: Wed, 18 Jan 2017 15:40:46 +0100 Subject: Refs #2404: Set ol map projection to EPSG-4326 and prepare extent for API call Signed-off-by: Thomas Shawarma Haddad --- .../es6_browserified/itineraries/components/OlMap.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/es6_browserified/itineraries/components/OlMap.js b/app/assets/javascripts/es6_browserified/itineraries/components/OlMap.js index 25222c949..19b36c52e 100644 --- a/app/assets/javascripts/es6_browserified/itineraries/components/OlMap.js +++ b/app/assets/javascripts/es6_browserified/itineraries/components/OlMap.js @@ -11,9 +11,10 @@ class OlMap extends Component{ var map = new ol.Map({ target: 'stoppoint_map' + this.props.index, layers: [ - new ol.layer.Tile({ - source: new ol.source.OSM() - }) + new ol.layer.Tile({ + source: new ol.source.OSM(), + projection: 'EPSG:4326' + }) ], controls: [ new ol.control.ScaleLine() ], interactions: ol.interaction.defaults({ @@ -21,9 +22,14 @@ class OlMap extends Component{ }), view: new ol.View({ center: ol.proj.fromLonLat([2.349014, 48.864716]), - zoom: 18 + zoom: 18, + projection: 'EPSG:4326' }) }); + debugger + // TODO when fetching, use extent value in EPSG 4326 + // var extent = map.getView().calculateExtent(map.getSize()); + // ol.proj.transformExtent(a,"EPSG:3857",'EPSG:4326') } } -- cgit v1.2.3