Openlayers 3 coordinate conversions -


newb alert: i'm new openlayers 3 , mapping in general. background in sql server, , end systems design. have no experience in html, javascript, web development etc. i'm sure simple issue can't seem figure out details.

i've modified 1 of samples openlayers.org , doesn't behave expected. uses geojson object , draws points on map, don't end expected. apparently there conversion or happens.

the sample used here: geojson example

my test map here: test map

the geojson object defined as

        var geojsonobject = {             'type': 'featurecollection',             'crs': {                 'type': 'name',                 'properties': {                     'name': 'epsg:3857'                 }             },             'features': [               {                   'type': 'feature',                   'geometry': {                       'type': 'point',                       'coordinates': [0, 0]                   }               },               {                   'type': 'feature',                   'geometry': {                       'type': 'point',                       'coordinates': [-8.575653e6, 4.70681e6]  //white house, washington dc lon -77.03648269999997 lat 38.89767579999999                   }               }             ]         }; 

through little trial , error, able point display on white house lawn (nsa has no doubt flagged conversation) , there no resemblance latitude , longitude pulled different source. understand order of coordinates [lon, lat] can see no rhyme or reason -77.036 = -8.575e6. other point [0,0] displays right expect it.

i have tried figure out myself , searched quite few places, can't seem find answer.

also, if direct me tutorials, appreciated. thanks!

your geojson data in epsg:3857, different coordinate system latitude/longitude. coordinates not equal, represent same geographical location.

see http://spatialreference.org/ref/sr-org/6864/ information epsg:3857. map there shows difference between given points coordinates in coordinate reference systems.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -