Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
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
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=
>
<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;"
<script>
function
getMapExtent() {
var
map = $find(
"<%=RadMap1.ClientID%>"
).get_kendoWidget();
coords = map.extent();
alert(
"North West corner: "
+ coords.nw.toString());
}
</script>
Regards,