@welcomenxj Welcome to Q&A forum!
How exactly did you draw the line? Did you try from left to right?
I just tried with the sample code available here: Draw Line and able to draw a line between the points you mentioned.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Am trying to plot direct line between "green arrow location"(right top corner) to "destination popup point". But it's moving all around world as shown in picture. Any suggestion? Please find image for reference.
Other lines whose points are not on world edges are working fine.
@welcomenxj Welcome to Q&A forum!
How exactly did you draw the line? Did you try from left to right?
I just tried with the sample code available here: Draw Line and able to draw a line between the points you mentioned.
Managed to reproduce the issue and after talking with one of our architects I was reminded that the GeoJSON specification does not allow shapes to cross the antemeridian. I'm not a fan of this, luckily there are a few ways around this:
Options 1:
Option 2:
Here is a code sample showing all two options:
EDIT: Site doesn't let me copy in code or attach the file, I've uploaded the code here: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/master/AzureMapsCodeSamples/Experimental/Lines%20that%20cross%20the%20Anetmeridian%20.html