[OpenLayers-Users] How to display a specific place ?
Ravi Krishna
ravikrishna at qburst.com
Thu May 20 23:40:55 EDT 2010
Thanks cdobell,
It worked :)
On Fri, May 21, 2010 at 12:22 AM, cdobell [via OSGeo.org] <
ml-node+5081089-668295985-541374 at n2.nabble.com<ml-node%2B5081089-668295985-541374 at n2.nabble.com>
> wrote:
> First, make sure that you're adding your google layer to map. In one of
> your examples, you only added the wms layer.
>
> Second, since google maps are EPSG:900913, you'll need to pass it meters
> instead of a lon,lat. Set up a point or bounds you know (lon,lat) and then
> transform that point/bounds to the google projection.
>
> // I saw a reference to this lat,lon coordinate: 63.259591,-144.667969
>
> var GEOGRAPHIC_PROJECTION = new OpenLayers.Projection("EPSG:4326"); // stnd
> LAT,LON via WGS84 datum
> var MERCATOR_PROJECTION = new OpenLayers.Projection("EPSG:900913"); //
> '900913' == 'GOOGLE' projection
> var IndiaCenterPointGeographic = new
> OpenLayers.LonLat(-144.667969,63.259591); // lon,lat
> var IndiaCenterPointMercator =
> IndiaCenterPointGeographic.transform(GEOGRAPHIC_PROJECTION,MERCATOR_PROJECTION);
>
> var startZoomLevel = 5;
> //....
> //set up map and layers...
> //....
> map.setCenter(IndiaCenterPointMercator,startZoomLevel);
>
>
> ------------------------------
> View message @
> http://osgeo-org.1803224.n2.nabble.com/How-to-display-a-specific-place-tp5063850p5081089.html
> To unsubscribe from How to display a specific place ?, click here<http://osgeo-org.1803224.n2.nabble.com/subscriptions/Unsubscribe.jtp?code=cmF2aWtyaXNobmFAcWJ1cnN0LmNvbXw1MDYzODUwfDEwODY3NjQzMTg=>.
>
>
>
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-display-a-specific-place-tp5063850p5082565.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100520/f0b1cdb9/attachment.html
More information about the Users
mailing list