This is a migrated thread and some comments may be shown as answers.

Get coordinates from click

2 Answers 292 Views
Map
This is a migrated thread and some comments may be shown as answers.
Nicolas
Top achievements
Rank 1
Nicolas asked on 29 Aug 2017, 10:00 AM

Hi,

How can i get WGS84 coordinates from radmap click event?

Regards,

2 Answers, 1 is accepted

Sort by
0
Nicolas
Top achievements
Rank 1
answered on 29 Aug 2017, 10:06 AM

Problem solved :

Point p = this.radMap1.MapElement.PointFromScreen(new Point(e.X, e.Y));
            PointL pl = new PointL(p.X + this.radMap1.MapElement.ViewportInPixels.Location.X, p.Y +this.radMap1.MapElement.ViewportInPixels.Location.Y);
            PointG location = MapTileSystemHelper.PixelXYToLatLong(pl.X, pl.Y,this.radMap1.MapElement.ZoomLevel);
            pin.Location = new PointG(location.Latitude, location.Longitude);

0
Hristo
Telerik team
answered on 29 Aug 2017, 11:20 AM
Hello Nicolas,

Thank you for writing.

Indeed that is the correct approach for obtaining the coordinates when clicking on the map.

Please let me know if you have other questions.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Map
Asked by
Nicolas
Top achievements
Rank 1
Answers by
Nicolas
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or