transform from map geometry to control coordinate

Topics: SharpMap v0.9 / v1.x, SharpMap v2.0, Web Controls
Nov 26, 2010 at 9:45 AM

hello,

i want to implement a tooltip in my map like google.this means a label that is dynamic and when your mouse is over this label,tooltip raise and show information.

now,i don't know how transform the geometry of a place or element in my map to AjaxMap control coordinate and when i pan the map these labels doesn't change their positions.

check this example to understand my problem:

http://www.rotson.com/pic/example.jpg

for example (50.97048 , 35.8568) is the geometry of map,and i want to know what is this geometry  in the control box? => (AjaxMap control: ?px,?px )

thanks alot.

 

Coordinator
Nov 29, 2010 at 8:13 AM

hello shahin_sharifi,

the SharpMap.Map object has two utility functions:

  • ImageToWorld and
  • WorldToImage

These can help you to transform the coordinates the way you want. The Image Coordinates are always relative to the top left corner, keep that in mind if you think the results are wrong.

Hth FObermaier

 

Dec 2, 2010 at 11:04 AM
Edited Dec 2, 2010 at 11:07 AM

hi FObermaier,

thanks for your answer.i found a post in discussions about "Added Markers on web map but not able to move them" that has a relation with my problem.

Its writer is inactive now,and i can't ask from him.do you have any example about this approach? do you test his solution?

this link is: 

http://sharpmap.codeplex.com/Thread/View.aspx?ThreadId=65391

Coordinator
Dec 2, 2010 at 12:46 PM
Edited Dec 2, 2010 at 1:32 PM

Hello shahin sharifi,

I am not at all a web guy, I have no idea where those code snipplets belong in order to make it work. Sorry

At this place you may find what you are looking for: http://makempas.codeplex.com

FObermaier

Dec 2, 2010 at 1:55 PM

thank you