Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm developing an application where the user can view and edit a street grid of a city. The streets are presented as features on a vector layer, and the user has to be able to modify the elements (both the attributes and the geometry - which is LineString - of the feature). The editing of a geometry is limited to dragging the end points of the LineString, at least for now.

The trick is that the new end points must intersect with the current geometry of the feature, so that the user cannot drag a road to start from outside of the street grid. Also, modifying the geometry should affect the neighbouring geometries, if any. That is, if another road begins where one ends, both should have their start/end point changed.

I don't suppose OpenLayers supports this out of the box so how should I begin to implement this?

share|improve this question
    
did you try to use snapping with openlayers? –  Aragon Jan 15 '13 at 7:57
    
I believe one can only snap to other elements, not to "itself". However, I suppose it would be possible to temporarily clone the feature to another vector layer, use the snapping feature to snap the clone to its original feature and then clone back the modified feature to the original layer. That wouldn't solve the problem with modifying the neighbouring geometry though. –  mrLite Jan 15 '13 at 8:09
    
Its a good question. Upvote. –  Magno C Jan 15 '13 at 10:04
    
I used to use a custom coded proprietary editor that could do this and it used open source libraries, which ones I don't know, unfortunately. It was very handy though, used by a company called GDT –  lewis Feb 5 '13 at 19:39
add comment

1 Answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.