I am new to this tool and could really use your help. Thank you for your time.
I have a simple highlight layer that is created as such:
BaseStatesLayer.Open() Map1.HighlightOverlay.HighlightStyle = New FeatureOverlayStyle(GeoColor.GeographicColors.Forest, GeoColor.StandardColors.LightYellow, 2) For Each feature As Feature In BaseStatesLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.NoColumns)
Map1.HighlightOverlay.Features.Add(feature.Id, feature) 'Removed next line as it doesn't do not operate as expected-- throws a json error 'Map1.HighlightOverlay.OnClientClick = "function(map){alert('Client Click.');}" 'Removed next line as it cannot locate asp.net function HighlightOverlay_Click and asks to "raise event"? 'Map1.HighlightOverlay.Click += new EventHandler(HighlightOverlay_Click);
Next BaseStatesLayer.Close()
When I click on the highlight, nothing happens. The function Map1_Click only fires when the highlight is not active.
Is there a simple way to interesect the click? I've read through the forums that a client side postback is an option, but I am not sure how to execute this.
Protected Sub EventLayer_Click(ByVal sender As Object, ByVal e As MapClickedEventArgs)
Dim a
a = 5
End Sub
-----------------------------------------------
I get this error:
Default.aspx.vb(88) : error BC31143: Method 'Protected Sub EventLayer_Click(sender As Object, e As ThinkGeo.MapSuite.WebEdition.MapClickedEventArgs)' does not have a signature compatible with delegate 'Delegate Sub EventHandler(Of ThinkGeo.MapSuite.WebEdition.HighlightFeatureOverlayClickEventArgs)(sender As Object, e As ThinkGeo.MapSuite.WebEdition.HighlightFeatureOverlayClickEventArgs)'.
I have the feature id using this method… is there a workaround where I could use the QueryTools against this id…?
I really simply wish that there was a a method to stop intersecting the click at the highlight layer and have it pass through the base. This was my original goal, but I keep doing work arounds…
I have a hover state set using the highlight layer. All's good. My problem was that when it's clicked, it does not confer the same information as when a base layer is clicked.
HighlightFeatureOverlayClickEventArgs vs. MapClickedEventArgs
Now that I am in the click handler for the HighlightOverlay, I am trying to get information such as e.position:
...
shapeFileLayer.Open()
Dim selectedFeatures As Collection(Of Feature) = shapeFileLayer.QueryTools.GetFeaturesContaining(e.Position, New String(0) {"STATE_NAME"})
I apologize. This is kind of a fragmented example. I am right in the middle of debugging.
My ORIGINAL intent was to ignore the click on the highlight layer and let the Map1_Click handle the event. All the code was working, but I am attempting to add a hover state to the highlight layer.
Do you want to get your "STATE_NAME" value in HighlightFeatureOverlayClickEventArgs?
Do you make sure you add your feature like this: For Each feature As Feature In BaseStatesLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.NoColumns) ?
If so, you cannot get any value because you choose ReturningColumnsType.NoColumns, you need choose ReturningColumnsType.AllColumns there.
to zoom in on what was clicked. My problem is that the examples all rely on e.position which is a property of MapClickedEventArgs, but not of HighlightFeatureOverlayClickEventArgs
My unfortunate experience is that all of the things worked prior to adding the highlight layer.... If I can't get this to work, is there a way to get a hover state and just have the click "pass-through" to the original click handler?
For HighlightFeatureOverlayClickEventArgs we have e.Location to get its position. And you can directly get the selected feature by e.ClickedFeature so that you don’t need do spatial query in layer.
If I miss some points you mentioned please let me know.