Completed
Last Updated: 30 Oct 2020 21:22 by ADMIN
ejb
Created on: 03 Sep 2015 13:52
Category: Map
Type: Feature Request
2
In the Kendo/ASP.Net Map add the option for a legend with distance scale
In the Kendo/ASP.Net Map add the option for a legend with distance scale that updates on zoom level.  See attached image for placement and function 
Attached Files:
2 comments
ADMIN
Vessy
Posted on: 30 Oct 2020 21:22

Hi guys,

the Map provides with the basic info via the extent() method and the Location class.

The requested functionality can be achieved by calculating the total distance (in m) visible across the map mid-line:

var extent = map.extent();
var center = map.center();

var eastCenter = new Location(center.lat, extent.nw.lng);
var westCenter = new Location(center.lat, extent.se.lng);
var distance = eastCenter.distanceTo(westCenter);

From there the map scale (m/px) is:

var width = map.element.width();
var scale = Math.round(distance / width);


You can see a runnable sample demonstrating this approach here:

http://dojo.telerik.com/@tsvetomir/ubiqO/

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

David
Posted on: 13 Nov 2015 13:53
Concur.
This exists in the Silverlight control.