I'm mapping locations. some times companies have multiple assets at the same address or same Longitude/Latitude. When this is rendered on the map it shows up as one pin and all the rest get lost in the ether. I ran across some Kendo example that is supposed to pad the pins. It doesn't work. How do we get multiple pins to render at the same location or how do we get one pin to show multiple sets of data?
Map code is pretty simple:
<telerik:RadMap RenderMode="Lightweight" runat="server" ID="mapSite" Zoom="4" CssClass="MyMap Rounded" Width="100%" Height="100%">
<DataBindings>
<MarkerBinding DataShapeField="Shape" DataTitleField="SITE_CITY" DataLocationLatitudeField="Latitude" DataLocationLongitudeField="Longitude" />
</DataBindings>
<LayersCollection>
<telerik:MapLayer Type="Tile" Subdomains="a,b,c"
UrlTemplate="https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
Attribution="">
</telerik:MapLayer>
</LayersCollection>
</telerik:RadMap>
Code behind:
Binding code:
Dim res = From x In db.SITEs
Where x.COMPANY.COMPANY_CODE.Equals(Session("Market").ToString)
Select New clsSiteData With {
.Shape = "PinTarget",
.SITE_ID = x.SITE_ID,
.SITE_CODE = x.SITE_CODE,
.SITE_NAME = x.SITE_NAME,
.SITE_ADDRESS_1 = x.SITE_ADDRESS_1,
.SITE_ADDRESS_2 = x.SITE_ADDRESS_2,
.SITE_CITY = x.SITE_CITY,
.STATE_CODE = x.STATE.STATE_CODE,
.POSTAL_CODE = x.SITE_POSTAL_CODE,
.BUILDING_ID = x.SITE_BUILDING_IDENTIFIER,
.PROPERTY_ID = x.PROPERTY_CODE.PROPERTY_CODE,
.Latitude = If(x.SITE_MAP_LAT, 0),
.Longitude = If(x.SITE_MAP_LON, 0)
}
mapSite.DataSource = res.ToList
mapSite.DataBind()
ItemDataBound:
Private Sub mapSite_ItemDataBound(sender AsObject, e As MapItemDataBoundEventArgs) Handles mapSite.ItemDataBound
Dim htmlTemplate AsStringTry
hlAssInv.Visible = CType(ViewState("Asset"), Boolean)
htmlTemplate = getInnerHTML(tblTemplate)
Dim marker As MapMarker = TryCast(e.Item, MapMarker)
If marker IsNothingThenReturnEndIfDim item As clsSiteData = TryCast(e.DataItem, clsSiteData)
marker.TooltipSettings.Content = [String].Format(htmlTemplate,
item.SITE_CODE,
item.SITE_NAME,
item.SITE_ADDRESS_1,
item.SITE_ADDRESS_2,
item.SITE_CITY,
item.STATE_CODE,
item.POSTAL_CODE,
item.BUILDING_ID,
item.PROPERTY_ID,
item.SITE_ID)
Catch ex As Exception
Dim xxx AsString = ex.Message.ToString
End Try
End Sub