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

Boundary latitude and longitude

2 Answers 151 Views
Map
This is a migrated thread and some comments may be shown as answers.
KK60
Top achievements
Rank 1
KK60 asked on 29 Mar 2017, 03:56 PM

Hi All,

I'm new to RadMap. Can you please let me know how can I find the upper left (or lower right) latitude and longitude of the current map? Is that possible to do so with RadMap? I can do that with MapQuest UI by using getBounds method.

 

Thanks for your help.

Huy

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 31 Mar 2017, 10:23 AM

Hi Huy,

You can use the extent() method of the underlying Kendo Map widget. For example:

<telerik:RadMap RenderMode="Lightweight" runat="server" ID="RadMap1" Zoom="4" Width="500" Height="500">
    <CenterSettings Latitude="39.639537564366705" Longitude="-92.548828125" />
    <LayersCollection>
        <telerik:MapLayer Subdomains="a,b,c" UrlTemplate="http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png" Attribution="© OpenStreetMap"></telerik:MapLayer>
    </LayersCollection>
</telerik:RadMap>
<asp:Button ID="Button1" Text="get map extent" OnClientClick="getMapExtent(); return false;" runat="server" />
<script>
    function getMapExtent() {
        var map = $find("<%=RadMap1.ClientID%>").get_kendoWidget();
        var coords = map.extent();
        alert("North West corner: " + coords.nw.toString());
    }
</script>

Regards,

Marin Bratanov
Telerik by Progress
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.
0
KK60
Top achievements
Rank 1
answered on 03 Apr 2017, 07:34 PM
Thanks Marin.
Tags
Map
Asked by
KK60
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
KK60
Top achievements
Rank 1
Share this question
or