Screen Coordinates from Location

5 posts, 0 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    Nov 2011

    Posted 08 May 2012 Link to this post

    I've searched as best as I could, but there seems to be no way to go from a Location to screen coordinates.

    It should be more obvious than this...

    On Bing maps it is ViewportPointToLocation and LocationToViewportPoint...
  2. Michael
    Michael avatar
    6 posts
    Member since:
    Nov 2011

    Posted 08 May 2012 Link to this post

    RadMap.SpatialReference.LogicalToGeographic
    RadMap.SpatialReference.GeographicToLogical

    Thanks,
    Michael
  3. DevCraft banner
  4. Michael
    Michael avatar
    6 posts
    Member since:
    Nov 2011

    Posted 08 May 2012 Link to this post

    Nope, that was not it either... some kind of 'logical' point between 0 and 1? Is this the ratio of the screen coordinates or something?

    I just want to convert a point on the screen to a Location and then be able to convert that Location back to a point on the screen...
  5. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 11 May 2012 Link to this post

    Hi Michael,

     You can use the GetCoordinates method of the Location class to achieve this. You may find a sample demonstrating it in our blogpost (How To Resize Map shapes with mouse dragging) where on MouseMove we get the coordinates of the clicked pinpoint relative to the map control screen coordinates.  

    Kind regards,
    Evgenia
    the Telerik team
     
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
     
  6. Michael
    Michael avatar
    6 posts
    Member since:
    Nov 2011

    Posted 11 May 2012 Link to this post

    I wanted to go from a geographic coordinate to a pixel location.

    I found it:

    Location.LogicalToPixel(RadMap, RadMap.SpatialReference.GeographicToLogical(Point());
Back to Top
DevCraft banner