I have a Desktop app with WorldMapKit and MapSuite 6.0. I'm adding a feature to allow the user to drag-and-drop any .shp file onto a map to be displayed (like you can in Map Suite Explorer). Starting simple right now to just get the shapefile to display on the map. The code below runs but I can't see the shapefile displayed. What am I doing wrong?
Dim shapefileStaticOverlay As New LayerOverlay
Map1.Overlays.Add(
"ShapeFilesOverlay", shapefileStaticOverlay)
Private Sub loadShapeFile(ByVal filename As String)'Grab our shapefiles layer overlay:
Dim shapefilesLayerOverlay As LayerOverlay = DirectCast(Map1.Overlays("ShapeFilesOverlay"), LayerOverlay)Dim newShapeFileLayer As New ShapeFileFeatureLayer(filename)'make sure there is an index file built else we'll get and error loading
newShapeFileLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =
newShapeFileLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle =
shapefilesLayerOverlay.Layers.Add(
ShapeFileFeatureLayer.BuildIndexFile(filename, BuildIndexMode.DoNotRebuild)ApplyUntilZoomLevel.Level20AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green))"shapefileKeyname", newShapeFileLayer)Map1.Refresh End Sub