Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid latitude value: must be between -90 and 90

I'm trying to create a map by javascript Azure Map in my phonegap app, but it gives the following error:

atlas.min.js?api-version=1.0:362 Uncaught (in promise) Error: Invalid LngLat latitude value: must be between -90 and 90

And my code:

 var map = new atlas.Map("task-map-view", {
        "subscription-key": MapsAccountKey,
        center: [39.749434, -104.930420],
        zoom: 8
    });

any suggestions?

like image 519
hnakao11 Avatar asked Oct 24 '25 22:10

hnakao11


1 Answers

It looks like you have reversed your latitude and longitude values. Note that Azure maps coordinates are represented as [longitude, latitude].

If you are curious as to why, longitude is equivalent to x and latitude to y, thus [x, y]

like image 56
rbrundritt Avatar answered Oct 27 '25 13:10

rbrundritt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!