[OpenLayers-Users] Re: EditingToolbar with Google Base layer
Andreas Hocevar
ahocevar at opengeo.org
Mon Jul 18 08:04:54 EDT 2011
Hi,
OpenLayers.Bounds are not pixel coordinates, but projected
coordinates. Change your report_1 function to the following and you
will be happy:
function report_1(event) {
var bounds = event.feature.geometry.getBounds();
var llBounds = bounds.transform(map.getProjectionObject(), new
OpenLayers.Projection("EPSG:4326"));
alert(llBounds.toString());
}
Andreas.
On Thu, Jul 14, 2011 at 5:29 PM, Filipe <filipesilva1 at gmail.com> wrote:
> Hi there, Thanks for your reply.
>
> However, even using the 3.5 api, i still cant get the lat long on the
> geometry that was draw with the drawFeature.
> Even tried to use the "sphericalMercator: true" on the google layer with no
> success.
>
> Can you give me any hints?
>
> Bellow is the code im using with the 3.5 api.
> <html>
> <head>
>
>
>
>
>
>
>
>
> </head>
> <body onload="init()">
> <div id="map" style="width:500px; height:500px;"></div>
> <div id="coordinates"></div>
> </body>
> </html>
>
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/EditingToolbar-with-Google-Base-layer-tp6572115p6583724.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list