ThinkGeo.com    |     Documentation    |     Premium Support

About world coordinates to screen coordinates add into OverlayCanvas

I derived from the Overlay class a PathOverylay classes are used to map path, I will the world coordinates into screen coordinates usingExtentHelper. ToScreenCoordinate, will draw bezier path. Add the screen coordinates to the OverlayCanvas of PathOverylay, but the path I drew is not correct. I used the MapClick method in the demo to take the screen coordinates and the world coordinates to find the world coordinates of the screen coordinates that I converted. But I’m not going to add it to the OverlayCanvas according to this screen coordinate, do I need to do anything else?

Hi Zhangming,

Sorry I cannot understand your requirement here clearly, could you please create a simple sample to show what you did and what you want to get, some more screen shots or video is also helpful.

You can quickly create our sample base no this guide: http://wiki.thinkgeo.com/wiki/map_suite_project_template_guide

Regards,

Ethan

Hi Ethan
I created a demo program send to you, you can click on the showdot and showpath button and you can see that it’s not mapped, it’s not starting from the point, it’s offset. ThinkGisDemo.zip (2.7 MB)

Regards,
Zhangming

Hi Zhangming,

a. It looks you implement your code by WPF control but not our map, our developer look into it and found your code have some problem, in the function Draw of GisPath.cs you should want to modify it like this:
Canvas.SetLeft(gisPath, 0);
Canvas.SetTop(gisPath, 0);

Because the path contains the data, you only need put them in the upper-left corner.

b. Your point don’t match the map is because coordinates offset, your data is not exact.

You can choose GoogleMap or BingMap as background layer, and you can see the airport coordinates still keep offset.

And you can also search on Google or Bing or OSM online map to double check the coordinates.

Regards,

Ethan