markerLayer.Open() Dim item As New FeatureSourceColumn("rap") markerLayer.Columns.Add(item)
Dim value As Double Dim LocID As String
Do While dtrMark.Read() value = CDbl(dtrMark("Result")) LocID = dtrMark("LocID").ToString() Dim feature As New Feature(CDbl(dtrMark("Longitude")), CDbl(dtrMark("Latitude")), value)
MarkerLayer.Open() MarkerFeatures = MarkerLayer.QueryTools.GetFeaturesIntersecting(clickArea, New String(1) {"Crap", "LocID"}) For Each feature As Feature In MarkerFeatures message.AppendFormat(GetResultsTable(feature.Id)) Next
The Feature above shows the column keys but empty values in debug mode. What amI doing wrong?
First, it seems that you are missing code to create the ‘LocID’ as a FeatureSourceColumn. I will need to see the code contained in your GetResultsTable method to determine if you are correctly parsing the feature.
If the feature.ColumnValues.Add("LocId", LocID) does not create Feature source column then I am missing it. How do I create FeatureSourceColumn?
The GetResultsTable jsut returns HTML code that populates the Popup.
I have that code working fine in other pages that do not use the Feature column. In here I need to pass the LocID in FeatureColumn because I need to pass the value in Dim feature As New Feature(CDbl(dtrMark("Longitude")), CDbl(dtrMark("Latitude")), value) to create the heatmap grid.
What I am trying to accomplish is that user will be capable to click on Markers that are base for the GRID. When they click on the marker popup needs to show the LocationId and the value.
Unless the "LocId" column already exists you need to create the FeatureSourcecolumn in a seperate line of code just as you did with your second line of code:
Dim item As New FeatureSourceColumn("rap")
The code feature.ColumnValues.Add("LocId", LocID) adds the value of LocID to the FeatureSouceColumn named "LocId". It does not create the FeatureSourceColumn that stores the data thus you need the code from above to create the FeatureSourceColumn.
There are a couple of other items I am a bit unsure about.
First you state that the code used to retrieve information about the MarkerFeatures works in other places. How is the code you provided different than the code that works?
Second I don't see the code you are using for your click event on your Feature. I am assuming that the GetResultsTable method is retrieving the information from the feature for viewing by your user.
The code you are using to setup the additional Columns for the FeatureSource and the additional ColumnValues for those columns looks fine (except for the missing LocId FeatureSourceColunn definition) so there must be an issue with the retrival of that information in your GetResultsTable method.
In my other pages I pass in the LocID as a value of the feature
Dim feature As New Feature(CDbl(dtrMark("Longitude")), CDbl(dtrMark("Latitude")), value)
that wirks fine, but i was never able to get the feature columns to work. i must be missing something.
Do you have simple working code (in VB) that passes a feature column value from a feature when it is clicked? Base overlay must be Google. That would help. Thanks.
I have several layers on top of the Google map. Can that be a problem?
Thanks for the code. It looks quite similar to what I have. The difference is that you are adding the columns to InMemoryMarkerOverlay and I am usinginMemoryFeatureLayer thus I need to use markerLayer.InternalFeatures.Add(feature)
Would it have any effect on passing the column value to on-click event?
Also you are using markerOverlay_Click while I am using Map1.Click and MarkerFeatures = MarkerLayer.QueryTools.GetFeaturesIntersecting(clickArea, New String(0) {"LocID"}) to retrieve the value
Could that be a problem? Are you able to pass the column values loaded into inMemoryFeatureLayer and retrieve it using QueryTools.GetFeaturesIntersecting?
Jakub, Can you provide me with a solution that can recreate this issue? The code you have provide is simply not enough for me to accurately recreate the problem as I am doing a lot of guess work as you how you have your code setup.