About lat/lng of drawed points

37 views
Skip to first unread message

Igor Thiesen

unread,
Apr 9, 2012, 10:13:36 AM4/9/12
to opensca...@googlegroups.com
Hello guys, i'm new at OpenScales.
I'm trying to catch the coordinates of the points, paths and polygons that i draw using the FeatureDrawing tool. Do you guys know how can i solve that?
Thank you.

WillPetty

unread,
Apr 11, 2012, 10:18:58 AM4/11/12
to opensca...@googlegroups.com
you can just loop through the features in the drawing layer and look at the lonlat attribute.

something like

 lat = (map.getLayerByName("Drawings") as VectorLayer).features[i].lonlat.lat
 lon = (map.getLayerByName("Drawings") as VectorLayer).features[i].lonlat.lon

for polygons/ paths you may need to go a bit deeper by looking at the components of a feature instead of just its lonlat, since the lonlat of a polygon is not actually one of its points but a mid-point( i think)
-will

Igor Thiesen

unread,
Apr 12, 2012, 4:26:56 PM4/12/12
to opensca...@googlegroups.com
Thx Will,
I was using version 1.2 with Mapnik and FeatureDrawing was working properly, now i'm trying to use version 2.1.1 and Bing map and the Select and Move tools are working but the drawing ones not, do you know what is happening?
Thx 

WillPetty

unread,
Apr 13, 2012, 1:30:17 PM4/13/12
to opensca...@googlegroups.com
Sorry, I do not. We are using 2.0 and the drawing features worked fine out of the box as far as i remember. If you are getting an error you can post the stack and ill take a quick look at it in my free time.
Sorry again,
Will

Igor Thiesen

unread,
Apr 17, 2012, 12:55:27 PM4/17/12
to opensca...@googlegroups.com
There's no error, it's just not drawing things at the map. =/
Thx

Em segunda-feira, 9 de abril de 2012 11h13min36s UTC-3, Igor Thiesen escreveu:
Reply all
Reply to author
Forward
0 new messages