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

PinPoints text overlapped

1 Answer 118 Views
Map
This is a migrated thread and some comments may be shown as answers.
Esther
Top achievements
Rank 1
Esther asked on 20 Jun 2012, 02:11 PM
Hello,
I have a problem with pinpoints location. I have several pinpoints loaded on the map  with a text that appears on the right.
The problem is that if I have two pinpoints very close the text of both points is overlapped.
Is there a way of showing the text in a proper way, avoiding this overlaps?
I attach an image of this trouble. Any idea?

I´d also like to change text Font (size,color..), how can I do that?

Thank you,

Esther

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 25 Jun 2012, 06:56 AM
Hello Esther,

You can't avoid overlapping of the pinpoints. But you can use the new feature we've introduced in the 2012.Q2 release: clustered data source.

Clustered data source provides functionality for grouping of the geographic locations using some criteria. The default implementation uses distance in degrees between 2 locations as grouping condition. It can be changed at any time by creation of the new class which implements IClusterItemGenerator or which inherits from the ClusterItemGenerator class (the default built-in implementation of the grouping condition).

The clustered data source provides information layer with 2 kinds of items: ClusterItem and ClusteredItem. The first one represents cluster which contains list of the items grouped by some criteria. The second one represents wrapper around original data with some additional functionality.

The behavior of the cluster is controlled by its state. It can be collapsed, expanded and expanded to polygon. The difference between expanded cluster and cluster expanded to polygon is as following: the expanded cluster uses original locations of the items to show them, the cluster which is expanded to polygon uses vertices of the regular polygon with center at the cluster’s center to show items.

The “expanded to polygon” mode is necessary when items are very close one to another (for example, several trucks are located on the same gas station), so simple expanding of the cluster will not give an ability to see details on every track (the elements will be overlapped even on the deep zoom level).

The collapsed cluster is always passed to the information layer. The expanded cluster passes its clustered items to the information layer. If HideExpanded property of the ClusterItem is set to true, then expanded cluster is not passed to the information layer. Otherwise it will be represented in the information layer.

Clustered data source can automatically force recreation of the clusters when zoom level is changed. This feature is controlled by GenerateClustersOnZoom property of the ClusteredDataSource class.

Please, find attached sample application which demonstrates using of the Clustered data source.

You can change text font using standard font-relative properties (FontFamily, FontSize and so on). For example:

<telerik:MapPinPoint telerik:MapLayer.Location="45.1307577507,-93.4362836439"
     ImageSource="/Telerik.RadMap.WPF.Current;component/Images/SelectionButton.png"
     Text="123456"
     FontFamily="Arial"
     FontSize="22"
     FontWeight="Bold"/>


All the best,

Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Map
Asked by
Esther
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or