ThinkGeo.com    |     Documentation    |     Premium Support

How to filter features

Hi everyone,


is there a way to filter features by several criteria?


I have a shapefile with 4000 cities and each of them has some attribute like State, flooded (yes/no), earthquake (yes/no), construction date and so on


I'd like to put on my page various controls like checkboxes and comboboxes to let the user compose filtering criteria.


Thnks in advance


Andrea



Egbert,  
  
 Thanks for evaluating Map Suite products! You can use ValueStyle for that scenario. Here is the sample code  
  
  
            // Set value style for flooded.
            ValueStyle valueStyleFlooded = new ValueStyle();
            valueStyleFlooded.ColumnName = "flooded";
            if(chkFlooded.Checked)
            {
                valueStyleFlooded.ValueItems.Add(new ValueItem("yes", PointStyles.Capital1));
            }
            else
            {
                valueStyleFlooded.ValueItems.Add(new ValueItem("no", PointStyles.Capital2));
            }

            // Set value style for earthquake.
            ValueStyle valueStyleEarthQuake = new ValueStyle();
            valueStyleEarthQuake.ColumnName = "earthquake";
            if (chkEarthquake.Checked)
            {
                valueStyleEarthQuake.ValueItems.Add(new ValueItem("yes", PointStyles.Capital1));
            }
            else
            {
                valueStyleEarthQuake.ValueItems.Add(new ValueItem("no", PointStyles.Capital2));
            }

            // Clear custom style, add new value style.
            citiesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
            citiesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyleFlooded);
            citiesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyleEarthQuake);

            // Please don’t forget Redraw after changed you overlays.
            layerOverlay.Redraw();
 
  
 Let me know for more queries! 
  
 Ben 


Hi Ben thank you very much for the quick response!


Your solution is very good but I have another question: if a city is flooded and heartquaked (and so on) do I get 2 (or more) symbols showing it on the map?


I need to have only one symbol per city on the map


And the next question is: actually I have all the data in a SQL2000 table; I first tried to loop on the records and put a Marker on the map for each city, but, as I supposed, it took too much time. So I found over the net a .NET wrapper for the ShapeLib library an now I'm creating the shapefile "on the fly", rebuilding his index and then loading and showing it on the map.


Is there a convenient way to bypass the shapefile and read data directly from the database?


thank you very much again


andrea



Andrea, 
  
 You guess right that you will get 2(or more) symbols showing if the poor city is both flooded and heartquaked, and the top icon will overwrite the bottom one. I think one solution is to add offset for every style, like every flooded icon shows on the upperLeft and heartquaked one shows on the upperright. Another solution is writing your own Style by inheriting the ValueStyle, override the DrawCore method, adding some checking there that if a feature has already is drawn then skip drawing it again.  That will not be too difficult. 
  
 About the 2nd problem: as SQl2000 doesn’t support spatial data, we cannot use it directly (that’s why we support MSSQl2008, Oracle and PostGre but not Sql2000). I wonder can you save all the data to inMemoryFeatureSource? If you can, we can show features or makers bases on that very easily. Here are some sample codes for it. 
  
 
// Columns: lon,lat,name,flooded,earthquake
        DataTable sql2000 = new DataTable("cityData");
        sql2000 = ReadSQL2000Data();

        Collection<FeatureSourceColumn> featureColumns = new Collection<FeatureSourceColumn>();
        featureColumns.Add(new FeatureSourceColumn("name"));
        featureColumns.Add(new FeatureSourceColumn("flooded"));
        featureColumns.Add(new FeatureSourceColumn("earthquake"));
        Collection<Feature> features = new Collection<Feature>();
        foreach (DataRow row in sql2000.Rows)
        {
            Feature feature = new Feature(Double.Parse(row["lon"].ToString()), Double.Parse(row["lat"].ToString()), Guid.NewGuid().ToString());
            feature.ColumnValues.Add("name", row["name"].ToString());
            feature.ColumnValues.Add("flooded", row["flooded"].ToString());
            feature.ColumnValues.Add("earthquake", row["earthquake"].ToString());
            features.Add(feature);
        }

        // bind markers with the feature source
        InMemoryFeatureSource inMemoryFeatureSource = new InMemoryFeatureSource(featureColumns, features);
       FeatureSourceMarkerOverlay featureSourceMarkerOverlay = new FeatureSourceMarkerOverlay();
       featureSourceMarkerOverlay.FeatureSource = inMemoryFeatureSource;
      Map1.CustomOverlays.Add(featureSourceMarkerOverlay);
 
  
 Let me know for any queries. 
  
 Ben 


Ben many many thanks


Your suggestions are exactly what I needed and all works fine


As usual there's a little problem I can't resolve: ValueStyle can't work with InMemoryFeatureSource and FeatureSourceMarkerOverlay (right?) so I switched to ValueMarkerStyle but no marker appears on the map. This is my code:



Dim dataTablePV As DataTable = ReadAllDataFromSQL()

        Dim featureColumns As New Collection(Of FeatureSourceColumn)
        featureColumns.Add(New FeatureSourceColumn("APVIDAPV"))
        featureColumns.Add(New FeatureSourceColumn("ASTFLAVA"))
        featureColumns.Add(New FeatureSourceColumn("APVFLTOB"))
        featureColumns.Add(New FeatureSourceColumn("APVFLPER"))
        featureColumns.Add(New FeatureSourceColumn("APVTXBRA"))
        featureColumns.Add(New FeatureSourceColumn("APVIDAFO"))

        Dim features As New Collection(Of Feature)
        For Each row As DataRow In dataTablePV.Rows

            Dim x As Double
            Dim y As Double

            If Double.TryParse(row("APVCOGEX").ToString(), x) AndAlso Double.TryParse(row("APVCOGEX").ToString(), x) Then

                Dim feature As New Feature(x, y, row("APVIDAPV"))
                feature.ColumnValues.Add("APVIDAPV", row("APVIDAPV").ToString())
                feature.ColumnValues.Add("ASTFLAVA", row("ASTFLAVA").ToString())
                feature.ColumnValues.Add("APVFLTOB", row("APVFLTOB").ToString())
                feature.ColumnValues.Add("APVFLPER", row("APVFLPER").ToString())
                feature.ColumnValues.Add("APVTXBRA", row("APVTXBRA").ToString())
                feature.ColumnValues.Add("APVIDAFO", row("APVIDAFO").ToString())

                features.Add(feature)

            End If

        Next

        ' bind markers with the feature source
        Dim inMemoryFeatureSource As New InMemoryFeatureSource(featureColumns, features)

        Dim styleM As New ValueMarkerStyle(FeatureColumnNameListeToBe)
        styleM.ValueItems.Add(New MarkerValueItem("", New PointMarkerStyle(New WebImage(Server.MapPath("images\bullet_red.gif")))))
        styleM.ValueItems.Add(New MarkerValueItem("0", New PointMarkerStyle(New WebImage(Server.MapPath("images\bullet_red.gif")))))
        styleM.ValueItems.Add(New MarkerValueItem("1", New PointMarkerStyle(New WebImage(Server.MapPath("images\bullet_yellow.gif")))))
        styleM.ValueItems.Add(New MarkerValueItem("2", New PointMarkerStyle(New WebImage(Server.MapPath("images\bullet_green.gif")))))

        Dim proj As New Proj4Projection()
        proj.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326)
        proj.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString()

        inMemoryFeatureSource.Projection = proj

        Dim featureSourceMarkerOverlay As New FeatureSourceMarkerOverlay()
        featureSourceMarkerOverlay.FeatureSource = inMemoryFeatureSource
        featureSourceMarkerOverlay.ZoomLevelSet.ZoomLevel01.CustomMarkerStyle = styleM
        featureSourceMarkerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
        Map1.CustomOverlays.Add(featureSourceMarkerOverlay)


I just can see the google map without markers


What can I do?


thanks


andrea



Ben,


I found an error in my code (a very stupid error); evidently in the line


 


If Double.TryParse(row("APVCOGEX").ToString(), x) AndAlso Double.TryParse(row("APVCOGEX").ToString(), x) Then 


 


the second TryParse call must operate on apvcogeY and y variable. I did correct my code but that didn't solve the problem


tnx andrea



Andrea, 
  
 FeatureSourceMarkerOverlay accepts MarkerStyles, so it accepts ValueMarkerStyle (inherited from MarkerStyle). InMemoryFeatureSurce accepts Styles, so it accepts ValueStyle(inherited from Style) but not MarkerStyle(not inherited from Style). MarkerStyle is for the client part rendering you can tell it works with markers, while Style is for server part rendering it works with the server side data. 
  
 We found a problem in your codes and that may be the cause of the problem.  
  
 
styleM.ValueItems.Add(New MarkerValueItem("", New PointMarkerStyle(New WebImage(Server.MapPath("images\bullet_red.gif")))))
 
  
 The first parameter for WebImage’s constructor is supposed to be the webpage virtual path, in your code though it is physical path.  Can you try using the virtual path instead, like “/images/bullet_red.gif" or "~/images/bullet_red.gif"? 
  
 Finally just remind don’t forget to set your MapUnit to Meter, and set the CurrentExtent to a proper value. 
  
 Thanks, 
  
 Ben 



The first parameter for WebImage’s constructor is supposed to be the webpage virtual path, in your code though it is physical path. Can you try using the virtual path instead, like “/images/bullet_red.gif" or “~/images/bullet_red.gif”?



Ben, I tried all the possible virtual paths instead the physical one: i tried this “images/bullet_red.gif”, this “/images/bullet_red.gif” and finally this “~/images/bullet_red.gif” but no one solved the problem.


I checked the mapunit and the current extent also.



FeatureSourceMarkerOverlay accepts MarkerStyles, so it accepts ValueMarkerStyle (inherited from MarkerStyle). InMemoryFeatureSurce accepts Styles, so it accepts ValueStyle(inherited from Style) but not MarkerStyle(not inherited from Style). MarkerStyle is for the client part rendering you can tell it works with markers, while Style is for server part rendering it works with the server side data.



Ben I wasn’t aware of that but tell me, how am I supposed to set the ValueStyle for my InMemoryFeatureSource? I can’t find a way


tnx, andrea



Andrea, 



Here is a complete sample where we create the data and render with ValueMarkerStyle, it works fine. 

 



If Not Page.IsPostBack Then
            Map1.MapBackground.BackgroundBrush = New GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"))
            Map1.MapUnit = GeographyUnit.Meter
            Map1.MapTools.MouseCoordinate.Enabled = True

            Dim google As New GoogleOverlay("Google Map")
            google.JavaScriptLibraryUri = New Uri(ConfigurationManager.AppSettings("GoogleUri"))
            google.GoogleMapType = GoogleMapType.Normal
            Map1.CustomOverlays.Add(google)

            Dim dataTablePV As DataTable = New DataTable()
            dataTablePV.Columns.Add("APVCOGEX")
            dataTablePV.Columns.Add("APVCOGEY")
            dataTablePV.Columns.Add("APVIDAPV")
            dataTablePV.Columns.Add("ASTFLAVA")

            For index As Integer = 1 To 10
                Dim row As DataRow = dataTablePV.NewRow()
                row("APVCOGEX") = -90 + index * 0.1
                row("APVCOGEY") = 40 + index * 0.1
                row("APVIDAPV") = index.ToString()
                row("ASTFLAVA") = index.ToString()
                dataTablePV.Rows.Add(row)
            Next

            Dim featureColumns As New Collection(Of FeatureSourceColumn)
            featureColumns.Add(New FeatureSourceColumn("APVIDAPV"))
            featureColumns.Add(New FeatureSourceColumn("ASTFLAVA"))

            Dim features As New Collection(Of Feature)
            For Each row As DataRow In dataTablePV.Rows

                Dim x As Double
                Dim y As Double

                If Double.TryParse(row("APVCOGEX").ToString(), x) AndAlso Double.TryParse(row("APVCOGEY").ToString(), y) Then

                    Dim feature As New Feature(x, y, row("APVIDAPV"))
                    feature.ColumnValues.Add("APVIDAPV", row("APVIDAPV").ToString())
                    feature.ColumnValues.Add("ASTFLAVA", row("ASTFLAVA").ToString())

                    features.Add(feature)

                End If

            Next

            ' bind markers with the feature source
            Dim inMemoryFeatureSource As New InMemoryFeatureSource(featureColumns, features)

            Dim styleM As New ValueMarkerStyle("ASTFLAVA")
            styleM.ValueItems.Add(New MarkerValueItem("", New PointMarkerStyle(New WebImage("\theme\default\img\marker.gif"))))
            styleM.ValueItems.Add(New MarkerValueItem("0", New PointMarkerStyle(New WebImage("\theme\default\img\marker_blue.gif"))))
            styleM.ValueItems.Add(New MarkerValueItem("1", New PointMarkerStyle(New WebImage("\theme\default\img\marker_gold.gif"))))
            styleM.ValueItems.Add(New MarkerValueItem("2", New PointMarkerStyle(New WebImage("\theme\default\img\marker_green.gif"))))

            Dim proj As New Proj4Projection()
            proj.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326)
            proj.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString()

            inMemoryFeatureSource.Projection = proj

            Dim featureSourceMarkerOverlay As New FeatureSourceMarkerOverlay()
            featureSourceMarkerOverlay.FeatureSource = inMemoryFeatureSource
            featureSourceMarkerOverlay.ZoomLevelSet.ZoomLevel01.CustomMarkerStyle = styleM
            featureSourceMarkerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
            Map1.CustomOverlays.Add(featureSourceMarkerOverlay)

            'Get the currentExtent of map
            inMemoryFeatureSource.Open()
            Map1.CurrentExtent = inMemoryFeatureSource.GetBoundingBox()
            inMemoryFeatureSource.Close()
        End If

ValueStyle is similar with ValueMarkerStyle. When using a ValueStyle, as it needs to specify one column to get the value and do the matching, you should make sure that column exists in your featureSource, especially when it is an InMemoryFeatureSource. In the above sample, the ValueMarkerStyle uses column “ASTFLAVA” for the matching, so if that column doesn’t exists in the InMemoryFeatureSource or there is no feature having the corresponding field for that column, nothing will be showed up. 




If Not Page.IsPostBack Then 
    Dim column1 As New Dictionary(Of String, String)() 
    column1.Add("name", "p1") 
    Dim feature1 As New Feature(New PointShape(0, 0), column1) 
    
    Dim column2 As New Dictionary(Of String, String)() 
    column2.Add("name", "p2") 
    Dim feature2 As New Feature(New PointShape(0, 100), column2) 
    Dim features As Feature() = New Feature() {feature1, feature2} 
    
    Dim featureSourceColumn As New FeatureSourceColumn("name") 
    Dim inMemoryFeatureLayer As New InMemoryFeatureLayer(New FeatureSourceColumn() {featureSourceColumn}, features) 
    
    Dim valueStyle As New ValueStyle() 
    valueStyle.ColumnName = "name" 
    valueStyle.ValueItems.Add(New ValueItem("p1", PointStyles.Capital1)) 
    valueStyle.ValueItems.Add(New ValueItem("p2", PointStyles.City1)) 
    
    inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle) 
    inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 
    
    Map1.MapUnit = GeographyUnit.DecimalDegree 
    
    Map1.StaticOverlay.Layers.Add(inMemoryFeatureLayer) 
End If

Hope that helps, Andrea. 



Ben 



 



Ben,


finally with your help all is working fine thank you very much


My final solution is based on your 2nd sample, this is my working code:




    Private Sub CreaLayerListe()

        If Map1.CustomOverlays.Contains(NomeOverlayListe) Then
            Map1.CustomOverlays.Remove(NomeOverlayListe)
        End If

        Dim tipoLista As TipiListe = DropDownListTipoListe.SelectedValue
        Dim nomeColonna As String = GetNomeColonnaByTipoLista(tipoLista)


        'Dim dataTablePV As DataTable = ReadAllDataFromSQL()
        Dim dataTablePV As DataTable = DatiPV 'property reading and caching from sql
        Dim features As New List(Of Feature)

        For Each row As DataRow In dataTablePV.Rows

            Dim x As Double
            Dim y As Double

            If Double.TryParse(row(FeatureColumnNamePosX).ToString(), x) AndAlso Double.TryParse(row(FeatureColumnNamePosY).ToString(), y) Then

                Dim val As String = ""

                If Not (row(nomeColonna) Is DBNull.Value) Then

                    val = row(nomeColonna)

                End If

                'Dim column As New Dictionary(Of String, String)
                'column.Add(nomeColonna, val)
                'Dim feature As New Feature(New PointShape(x, y), column)
                'features.Add(feature)


                Dim feature As New Feature(x, y, row(FeatureColumnNameCodPV))

                ' codice PV
                If row(FeatureColumnNameCodPV) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameCodPV, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameCodPV, row(FeatureColumnNameCodPV).ToString())
                End If

                ' lista as-is
                If row(FeatureColumnNameListeAsIs) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameListeAsIs, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameListeAsIs, row(FeatureColumnNameListeAsIs).ToString())
                End If

                ' lista to-be
                If row(FeatureColumnNameListeToBe) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameListeToBe, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameListeToBe, row(FeatureColumnNameListeToBe).ToString())
                End If

                ' lista permitting
                If row(FeatureColumnNameListePermitting) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameListePermitting, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameListePermitting, row(FeatureColumnNameListePermitting).ToString())
                End If

                ' brand
                If row(FeatureColumnNameBrand) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameBrand, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameBrand, row(FeatureColumnNameBrand).ToString())
                End If

                ' service
                If row(FeatureColumnNameService) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameService, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameService, row(FeatureColumnNameService).ToString())
                End If

                ' coord X
                If row(FeatureColumnNamePosX) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNamePosX, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNamePosX, row(FeatureColumnNamePosX).ToString())
                End If

                ' coord Y
                If row(FeatureColumnNamePosY) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNamePosY, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNamePosY, row(FeatureColumnNamePosY).ToString())
                End If

                ' ragione sociale
                If row(FeatureColumnNameRasoc) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameRasoc, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameRasoc, row(FeatureColumnNameRasoc).ToString())
                End If

                ' indirizzo
                If row(FeatureColumnNameIndir) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameIndir, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameIndir, row(FeatureColumnNameIndir).ToString())
                End If

                ' località
                If row(FeatureColumnNameLocal) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameLocal, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameLocal, row(FeatureColumnNameLocal).ToString())
                End If

                ' provincia
                If row(FeatureColumnNameProvi) Is DBNull.Value Then
                    feature.ColumnValues.Add(FeatureColumnNameProvi, "")
                Else
                    feature.ColumnValues.Add(FeatureColumnNameProvi, row(FeatureColumnNameProvi).ToString())
                End If


                features.Add(feature)

            End If

        Next

        'Dim featureSourceColumn As New FeatureSourceColumn(nomeColonna)
        'Dim inMemoryFeatureLayer As New InMemoryFeatureLayer(New FeatureSourceColumn() {featureSourceColumn}, features)

        Dim featureSourceColumns As New List(Of FeatureSourceColumn)
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameCodPV))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameListeAsIs))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameListeToBe))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameListePermitting))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameBrand))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameService))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNamePosX))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNamePosY))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameRasoc))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameIndir))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameLocal))
        featureSourceColumns.Add(New FeatureSourceColumn(FeatureColumnNameProvi))

        Dim inMemoryFeatureLayer As New InMemoryFeatureLayer(featureSourceColumns, features)

        inMemoryFeatureLayer.Name = NomeLayerListe

        Dim valueStyle As New ValueStyle()
        valueStyle.ColumnName = nomeColonna
        valueStyle.ValueItems.Add(New ValueItem("", New PointStyle(New GeoImage(Server.MapPath("images\bullet_red.gif")))))
        valueStyle.ValueItems.Add(New ValueItem("0", New PointStyle(New GeoImage(Server.MapPath("images\bullet_red.gif")))))
        valueStyle.ValueItems.Add(New ValueItem("1", New PointStyle(New GeoImage(Server.MapPath("images\bullet_yellow.gif")))))
        valueStyle.ValueItems.Add(New ValueItem("2", New PointStyle(New GeoImage(Server.MapPath("images\bullet_green.gif")))))

        valueStyle.RequiredColumnNames.Add(FeatureColumnNameCodPV)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameListeAsIs)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameListeToBe)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameListePermitting)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameBrand)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameService)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNamePosX)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNamePosY)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameRasoc)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameIndir)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameLocal)
        valueStyle.RequiredColumnNames.Add(FeatureColumnNameProvi)


        Dim proj As New Proj4Projection()
        proj.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326)
        proj.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString()

        inMemoryFeatureLayer.FeatureSource.Projection = proj

        inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle)
        inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20


        Dim over As New LayerOverlay(NomeOverlayListe, False, TileType.SingleTile)
        over.Layers.Add(inMemoryFeatureLayer.Name, inMemoryFeatureLayer)
        Map1.CustomOverlays.Add(over)

        AddHandler inMemoryFeatureLayer.DrawingFeatures, AddressOf LayerListe_DrawingFeatures

    End Sub


thank you again


andrea



Andrea, 
  
 It’s my pleasure, great it works. 
  
 By the way, you do not need to add all the columns to that RequiredColumnNames property, here is the documentation for that property and you will see.  
  
 “This property gets the collection of fields that are required for the Style. These are in addition to any other columns you specify in Styles that inherit from this one. For example if you have use a ValueSytle and it requires a column name for the decimalDegreesValue comparison then this column does not need to be in this collection. You only use the RequiredColumnNames for columns you need extra to those required by specific inherited styles.” 
  
 Thanks, 
  
 Ben