1

Somebody recommended me to use this site:- http://cs2cs.mygeodata.eu/ after I explained that this coordinates[-28.23078, 28.30707] which belongs to Bethlehem in South Africa centers the map to towards Congo. I'm using this array of coordinates on the view template(ol3view) that I have created with OpenGeo Suite. I still can't get it right, perhaps it's because I can't use that online application to transform my coordinates properly.

Please help me to display only South Africa and to center my map at Bethlehem (South Africa). To be precise, on launch I want my application to zoom to South Africa and center the map on Bethlehem (South Africa).

  • You need to either set your projection to 4326 (lat/lon) or convert to 3857, which is web mercator, and very commonly used in web mapping. This later is in meters, and the reason why you coordinates appear to be in the sea of the west coast of Africa. This can all be done very easily within OpenLayers simply by setting the correct CRS for the view. – John Powell Feb 5 '15 at 14:41
  • I've tried this way but i still yields the same results, it centers the map in the see like you've already have mentioned. view: new ol.View2D({ center: ol.proj.transform([-28.23078, 28.30707], 'EPSG:4326', 'EPSG:3857'), zoom: zoom }) – eldix_ Feb 9 '15 at 10:09
  • Thanx, I got it. – eldix_ Feb 9 '15 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.