I'm doing this:

function zoom_to (x,y,z) {
var p_stm = new OpenLayers.Projection("EPSG:3857");
var p_geo = new OpenLayers.Projection("EPSG:4326");
var pt = new OpenLayers.LonLat(x,y);
pt.transform(p_geo,p_stm);
the_map.setCenter(pt,z,false,false);
}

and it seems to work.  (my map is shown in EPSG:3857)

Peter

On Mon, Sep 15, 2014 at 6:08 AM, KhunSanAung <[email protected]> wrote:
> Hi All,
>
> I'm using OpenLayer to construct a map apps. The map layers are published by
> GeoServer.
> Taking input Lat/Long coordinate from user, I'd like to zoom the map to the
> specific point (Lat/Long).
> Or the map would reset the map center to the user's input Lat/Long location.
>
> Does any body ever done it or any body can guide me how to do it?
>
> Many thanks in advanced
>
> --
> Have a nice day!
> --
>
> Mr. Khun San Aung
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Peter N. Schweitzer (U.S. Geological Survey, Reston, VA 20192)
(703) 648-6533  email: [email protected]
http://geology.usgs.gov/peter/
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to