VE 4 polygons

I have created a bunch of polylines. So far so good. What I'd like to do is make these interact with the user.

The first thing I'd like to do, is do something when the user clicks on the poly. Having looked around this forum, I see this is a non-trival task, or at least this was the case with VE3, and I can't see any new stuff in VE 4 that changes this, so for the moment at least I'll hold off on that one. A brute force solution, as I'm using ASP .NET Ajax, is to get the lat/long of the user's click, and call a webservice which determines if the point lies inside a polygon (as all the data to draw the polygons resides on the server anyway). I can then at least work out which polygon was clicked.

The next thing I'd like to do, is have polygons highlight (change colour etc) in response to the user interacting with stuff outside the map (i.e. click on an item which says 'highlight x'). This sounds easy, as each poly has an ID, which in theory I should be able to use to find the relevant polygon. However I can only find an example of a constructor for a new polygon, and no example of finding an existing polygon and modifying it's properties. Is this possible I can't see anything in the documentation about this. There's a work around, where I can just draw a new polygon on top of the old one, with a different colour, and then delete that polygon when I'm done highlighting, but I hate to use brute force, when a more elegant solution might be possible.




Answer this question

VE 4 polygons

  • FenixBlue

    This actually has been discussed before, where people want to play with polygons like you can in local.live using the polygon tools.

    Your brute force method is probably the simplest way to go, as there currently are no available methods to allow you to modify existing polygons on the map.


  • VE 4 polygons