[pmapper-users] Capture coordinates of the polygon drawn with 'Measure area' in pmapper5
Brought to you by:
arminburger
From: Juan R. C. T. <jua...@uc...> - 2013-10-25 11:25:20
|
Thank you very much Armin, that's just what I was looking for. The coordinates of each vertex of a polygon drawn with the tool 'Measure area' are on the array: evt.geometry.components [0]. components To show the coordinates of each polygon points(EPSG: 4326): var pto; var sizeArray = evt.geometry.components sizeVector = evt.geometry.components[0].components.length; for (var i = 0; i <sizeArray, i + +) { pto = new OpenLayers.Geometry.Point(evt.geometry.components[0].components[i].x,evt.geometry.components[0].components[i].y); pto.transform (new OpenLayers.Projection ("EPSG: 900913"), new OpenLayers.Projection ("EPSG: 4326")); alert (pto.toShortString ()); // It shows lat, lon coordinates, in my case, here performed an ajax call to a php file to create a polygon geometry type in a database postgres with postgis. } Thanks again for the help, Regards, Juan Ramón Charco El 23/10/2013 19:39, Armin Burger escribió: > add an entry like the following to your custom.js file at the end: > > OpenLayers.Control.PMMeasureArea.prototype.showMeasureResults = > function(evt) { > console.log(evt); > } > > > Then use tools like Firebug to analyze the "evt" object that is logged > there. inside this evt object you will find an object like geometry and > you need to analyze the properties of this further on and use some > Javascript methods to extract and display the coordinates and put this > in this function. > > armin > > On 10/23/2013 01:23 PM, Juan Ramón Charco Toboso wrote: >> Hola, >> En pmapper5, Existe alguna forma de modificar el código de la >> herramienta 'Measure area' para que capture/muestre las coordenadas de >> los vértices del polígono dibujado ? >> >> El código de la herramienta 'Measure area' se encuentra en el archivo >> C:\ms4w\apps\pmapper\pmapper-5.0-beta2\js\src\PM.Control.PMToolMeasure.js >> >> Gracias de antemano, >> Juan Ramón >> >> Translation by Google: >> >> Hello, >> In pmapper5, there a way to modify the code of the tool 'Measure area' >> for capture / display the coordinates of the vertices of the polygon drawn? >> >> The code of the tool 'Measure area' is located in the file >> C: \ MS4W \ apps \ pmapper \ pmapper-5.0-beta2 \ js \ src \ >> PM.Control.PMToolMeasure.js >> >> Thanks in advance. >> Juan Ramón >> >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from >> the latest Intel processors and coprocessors. See abstracts and register > >> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk >> _______________________________________________ >> pmapper-users mailing list >> pma...@li... >> https://lists.sourceforge.net/lists/listinfo/pmapper-users >> > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk > _______________________________________________ > pmapper-users mailing list > pma...@li... > https://lists.sourceforge.net/lists/listinfo/pmapper-users |