I am trying to add different colored markers to my map based on different properties of each shape (properties stored in a separate database). I tried using multipe InMemoryMarkerOverlays but only the last overlay is visible. They apparently cover up the previously added overlay. Any way to prevent this from happening? Here is the creation code of one of the Overlays:
m_markerOverlayForeclosures = New ThinkGeo.MapSuite.DesktopEdition.InMemoryMarkerOverlay() With m_markerOverlayForeclosures .MapControl = WinformsMap1 .Columns.Add(New FeatureSourceColumn("APN")) .Columns.Add(New FeatureSourceColumn("SaleDate")) .Columns.Add(New FeatureSourceColumn("OpeningBid")) .Columns.Add(New FeatureSourceColumn("EstValue")) With .ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle .Image = New System.Drawing.Bitmap(".\images\MapMarkerGreen.gif") .Width = 20 .Height = 20 .YOffset = -10 .XOffset = -10 .ToolTipText = String.Format("APN: [#APN#]{0}SaleDate: [#SaleDate#]{0}OpeningBid: [#OpeningBid#]{0}EstValue: [#EstValue#]", vbCrLf) End With .ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 End With WinformsMap1.Overlays.Add("MarkerOverlayForeclosure", m_markerOverlayForeclosures)
Yes, for now as you already found, only one InmemoryMarkerOverlay or FeatureSourceMarkerOverlay can be used, so I suggest try to use the SimpleMarkerOverlay. Following screenshot shows how it can be achieved by using the SimpleMarkerOverlay, you may found some un transparent markers, that is because the marker images used are not transparent.
Can you please provide sample code of the above sample that using SimpleMarkerOverlay to show markers from different overlay? I tried AddSimpleMarkers project that comes with HowDoISamples, it adds a marker to the simple marker overlay everytime I click on the map. But it always shows the last marker.