Boundary latitude and longitude

3 posts, 0 answers
  1. KK60
    KK60 avatar
    14 posts
    Member since:
    Apr 2010

    Posted 29 Mar Link to this post

    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. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3899 posts

    Posted 31 Mar Link to this post

    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.
  3. KK60
    KK60 avatar
    14 posts
    Member since:
    Apr 2010

    Posted 03 Apr in reply to Marin Bratanov Link to this post

    Thanks Marin.
Back to Top