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 want to get drawn polygon coordinates.

var myLatLonSquare = vectorLayer.features[0].geometry.transform(map.getProjectionObject(), 
                     new OpenLayers.Projection("EPSG:4326"));

after zoom drawn polygon disappears because of geometry transform.

how can I solve this problem without disappearing drawn polygon?

Thanks

share|improve this question

1 Answer 1

up vote 6 down vote accepted

according to me it cant dissapear. the feature has changed due to the changes in the natural projection. Naturally, the feature might be located to 0,0.

if you want to see your feature:

map.zoomToExtent(vectorLayer.getDataExtent());

and still you can get your feature as,

vectorLayer.features[0]

i hope it helps you...

share|improve this answer
    
Yes you are right, I transformed again feature. Thanks!!! –  Iliaka Jun 19 '12 at 13:39

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.