I think in the hightlightLayerer to achieve Feature connection effect, but feature1.GetShape (.GetShortestLineTo) (feature2.GetShape), (GeographyUnit.Meter) is empty, errors may appear in where? But feature1 and feature2 are you can display graphics.
Two feature connection effect
Feature1 and feature2 are one by one on the map, do not know whether involved with this, if it is, can consider whether the center point for feature? Is it right? In the two feature center point line connection effect.
Hi Li,
Thanks for your post, I think the problem should be because “Feature1 and feature2 are one by one on the map” from your information, if two features intersects then “GetShortestLineTo()” will return null. Would you please provide us these two features’ Wkt for a further test? And if these two features intersect the idea of “center point for feature” should work with the following code:
“feature1.GetShape().GetCenterPoint().GetClosestPointTo(feature2.GetShape().GetCenterPoint());”
Waiting for your further information.
Johnny
Hi Li,
Thanks for your post, I think the problem should be because “Feature1 and feature2 are one by one on the map” from your information, if two features intersects then “GetShortestLineTo()” will return null. Would you please provide us these two features’ Wkt for a further test? And if these two features intersect the idea of “center point for feature” should work with the following code:
“feature1.GetShape().GetCenterPoint().GetClosestPointTo(feature2.GetShape().GetCenterPoint());”
Waiting for your further information.
Johnny
thinks for you answer !This problem can be solved. but ,I want to Two feature can be in OnMapCreateing of two feature connection.
I would like to ask whether the two feature in the OnMapCreateing client function for two feature connection effect, if you can please give examples.
Hi Li
Because on the client-side, there isn’t object that is equivalent of Feature on the server-side, so it’s not likely to achieve connection effect in “OnMapCreating” on client-side. If you have any more question, please feel free to let us know
Hope it helps
Johnny
HI Johnny
Interconnect effects have been achieved, because the line is based on the map.hightlightOverlayer.feature so the line is in the hightlightOverlayer, I want to put the line in map.hightlightOverlayer above, because the connection operation based on hightlightOverlayer.ContextMenu event will be excited, there is no way like custormerOverlayer, according to the order of layers display? (for example: finally showed the LayerOverlay is always at the top.)
HI Johnny
Interconnect effects have been achieved, because the line is based on the map.hightlightOverlayer.feature so the line is in the hightlightOverlayer, I want to put the line in map.hightlightOverlayer above, because the connection operation based on hightlightOverlayer.ContextMenu event will be excited, there is no way like custormerOverlayer, according to the order of layers display? (for example: finally showed the LayerOverlay is always at the top.)
Hi Li,
The lasted added feature is on above of other features by default, attached is a sample of our test, and here is a captured video of our test:
screencast.com/t/Fo0Jj1S8Y7
Hope it helps
Summer
Post11275.txt (1.65 KB)
HI Summer thinks for you answer!but
Because it is hightlightOverlay ContextMenu onclick function will generate an layerOverlay layer, I want to let hightLightoverlay at the bottom and can not hide.
Hi Li,
Attached is the sample code that should fit the functionality now, would you please check it, and here is a captured video of our test: screencast.com/t/pAXtLEvg
Hope it helps
Summer
Post11275Sample-2.txt (2.16 KB)