[OpenLayers-Users] How to go the the specific Lat/Long location?

Schweitzer, Peter pschweitzer at usgs.gov
Mon Sep 15 06:27:31 PDT 2014


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 <khunsanaung.gis at gmail.com> 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
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Peter N. Schweitzer (U.S. Geological Survey, Reston, VA 20192)
(703) 648-6533  email: pschweitzer at usgs.gov
http://geology.usgs.gov/peter/


More information about the Users mailing list