[Talk-co] coordenadas en wgs84 en openlayers-osm
eduardo kazt
kazt567 en hotmail.com
Mie Jun 9 04:32:26 BST 2010
bueno yo en el ejemplo de openlayers click probe a dejar asi
la funcion trigger, talvez funcione
trigger: function(e) {
var lonlat = map.getLonLatFromViewPortPx(e.xy).clone().transform(map.getProjectionObject(), new OpenLayers.Projection('EPSG:4326'));
alert("You clicked near " + lonlat.lat + ", " + lonlat.lon + "");
}
y si quieres pasar los datos a algo en la misma pagina usas algo asi
trigger: function(e) {
var lonlat = map.getLonLatFromViewPortPx(e.xy).clone().transform(map.getProjectionObject(), new OpenLayers.Projection('EPSG:4326'));
alert("You clicked near " + lonlat.lat + ", " + lonlat.lon + "");
document.getElementById(.......).value=lonlat.lon;
document.getElementById(.......).value=lonlat.lat;
}
donde los ........ es el elemento al que se desea llevar los datos
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.openstreetmap.org/pipermail/talk-co/attachments/20100608/bd024a03/attachment.html>
More information about the Talk-co
mailing list