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

Draw circle (margin) on map

3 Answers 117 Views
Map
This is a migrated thread and some comments may be shown as answers.
Gilbert van Veen
Top achievements
Rank 1
Gilbert van Veen asked on 30 Jun 2015, 09:22 AM

Hi,

I have a RadMap which is showing several hotspots. A hotspot is an area where (in my case) an employee is granted access.

On the RadMap each access point is showed with the exact geolocation information but in fact there is a little margin.

Per access point there is a margin (in meters). In other words an employee is granted access on geolocation xx.xx with a margin (radius/distance) of n meters.

It would be nice if it is possible to draw a circle around the access point which shows the margin?

Is this possible? and is there an example how to achieve this.

See the attached image for the example.

Thanks in advance,

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 02 Jul 2015, 08:59 AM
Hello Gilbert,

RadMap gives you the ability to use databinding both in Information layer or Visualization Layer. By defining itemTemplate you are able to define Ellipse / Path or other Framework elements which will suit your needs. Please review the following approach.

RadMap VisualizationLayer Data Binding

Regards,
Petar Mladenov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gilbert van Veen
Top achievements
Rank 1
answered on 03 Jul 2015, 11:35 AM

Thanks for the reply.

I can draw a circle on the hostpot but how can calculate the correct size of the circle?

The circle is a "margin/area" around the hotspot.

Back to my example, on the RadMap is an image (hotspot) which indicates that there is an access zone. In the properties off the access zone the user can enter margin in meters. What I need is an option to draw a circle around the hotspot (access zone) which indicates margin.

 So the user can see the access zone on the map including an extra circle which shows the margin around the zone.

The circle should have the correct scale.

 

 

0
Petar Mladenov
Telerik team
answered on 07 Jul 2015, 01:06 PM
Hello Gilbert,

To Draw a circle in RadMap you can use one of the following approaches:

- Use FrameworkElement (Ellipse or Path or other) and place it in Information Layer  or Visualization layer. To Position it you should use the attached property MapLayer.Location:
telerik:InformationLayer x:Name="informationLayer">
        <Ellipse x:Name="Ellipse1"
                    telerik:MapLayer.BaseZoomLevel="5"
                    telerik:MapLayer.Location="42.6957539183824, 23.3327663758679"
                    telerik:MapLayer.ZoomRange="5,12"
The negative effect here is that the Width and Height are specified in pixels.

- Use MapShape Object in Information Layer. For example MapEllipse. Width and Height are dependent on the current distance unit in the map - Mile or kilometer.

- Use ShapeData objects in VisualizationLayer. For example EllipseData. Widht and height are represented with spatial reference units (degrees by default).

In all the given solutions you need to manually calculate the location and width and height of the ellipse. Please keep in mind that the position / location is top-left oriented. In other word the top left point of the ellipse's bounding rectangle (which is somethind virtual) is used. This example is somehow similar to what you need, however we have no sample that automatically positions circle around certain hot spot.



Regards,
Petar Mladenov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Map
Asked by
Gilbert van Veen
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Gilbert van Veen
Top achievements
Rank 1
Share this question
or