[OpenLayers-Users] Pass an XY coordinate to my marker

BrianJBaldwin BrianJBaldwin at gmail.com
Fri Dec 14 13:14:54 PST 2012


I think this is a pretty simply problem, I just don't have the JS knowledge
to get it solved.  

This is the output from the address locator, where it pulls the XY of the
address.  I was to pass the geometry.x and geometry.y to my marker.

Here is the code from the address locator:

 function requestSuccess(response) {
            var format = new OpenLayers.Format.XLS();
            var output = format.read(response.responseXML);
            if (output.responseLists[0]) {
                var geometry = output.responseLists[0].features[0].geometry;
                var foundPosition = new OpenLayers.LonLat(geometry.x,
geometry.y).transform(
                        new OpenLayers.Projection("EPSG:4326"),
                        map.getProjectionObject()
                        );
                map.setCenter(foundPosition, 16);


Here is my marker location, can I just pass the new geometry to this point? 
If so, what is the best way to do this?

var myLocation = new OpenLayers.Geometry.Point()
				.transform('EPSG:4326', 'EPSG:3857');



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Pass-an-XY-coordinate-to-my-marker-tp5023145.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list