Web Intelligent Solutions
EnglishRomana
font size Increase font size Default font size Decrease font size
screen size Narrow screen resolution Wide screen resolution Auto adjust screen size
Home arrow WISroGIS Tutorials arrow How to set up Google maps with WISroGIS

How to set up Google maps with WISroGIS

Print E-mail

Action:

For distance measurements, the distances are computed as distances between projected longitude letitude coordinates between points.

Note that the area measurements, geometries drawn are planar geometries and the metrics returned by the measure control are planar measures by default. If your map is in a geographic projection or you have the appropriate projection definitions to transform your geometries into geographic coordinates, you can set the `Use geodesic` property of the control to true to calculate geodesic measures instead of planar measures.

Powered by WISroGIS 1.11 Zeus

Below is the code used to create a map with exchangeable Google layers: streets, satellite, hybrid and terrain.

Before using the example, please make sure you have set the following in the plugin's configuration interface

  1. added your site's Google API key
  2. set the Google API version to desired value - 2 would be ok for most of the situations
  3. enabled the Google layers

After these steps, copy/paste the below code to a plain text editor (to remove additional HTML formatting and any new lines), then paste the code to the article's content from your site.

{WISroGIS center_lon='22.0'| center_lat='38.3'| width='500px'| height='400px'| layerswitcher=1| panzoom_style=1| zoom_level=7|

baseLayer='Google("Google Streets")'| 

baseLayer='Google("Google Satellite",{type: G_SATELLITE_MAP})'|  

baseLayer='Google("Google Hybrid",{type: G_HYBRID_MAP})'|   

baseLayer='Google("Google Terrain",{type: G_PHYSICAL_MAP})'

~}

 To get the measurements extension working, one need to reproject the Google maps by setting the spherical Mercator option to true and specifying the map coordinates and display coordinates systems. The complete code for the Google maps above example - with the functional Measurement extension is listed below:

{WISroGIS center_lon='22.0'| center_lat='38.3'| width='500px'| height='400px'| layerswitcher=1| panzoom_style=1| zoom_level=7| measure='1'|

reprojectCenter='true'|

mapoptions='maxExtent: new OpenLayers.Bounds(-20037508,-20037508,20037508,20037508), maxResolution: 156543, units: "m", projection: "EPSG:900913", displayProjection:  new OpenLayers.Projection("EPSG:4326")'|

baseLayer='Google("Google Streets",{"sphericalMercator": true})'| 

baseLayer='Google("Google Satellite",{type: G_SATELLITE_MAP, "sphericalMercator": true})'|  

baseLayer='Google("Google Hybrid",{type: G_HYBRID_MAP, "sphericalMercator": true})'|   

baseLayer='Google("Google Terrain",{type: G_PHYSICAL_MAP, "sphericalMercator": true})'

~}


Digg!Del.icio.us!Technorati!Yahoo!Ma.gnolia!
 
< Prev   Next >
  • Rezultatul colaborarii noastre cu echipa WIS este faptul ca firma Eurosprint Travel a avut de castigat atat ca imagine, care s-a imbunatatit considerabil, cat si…
  • The WISro Yahoo Quotes component is a very powerful add-on and exactly the addon we were looking for.It was very easy to install and easy…
  • Va trimitem prezenta scrisoare pentru a va multumi pentru promptitudinea si rapiditatea cu care ne-ati raspuns cerintelor noastre. Apreciem calitatea serviciilor dumeavoastra, calitatea modului in…
  • Trumpet International made use the WIS.ro for both our website design and mapping component. The service was excellent and for us, we will most definately…
  • On behalf of the Board of Directors of Algal Engineering Ltd., I would like to take this opportunity and express our happiness for the quality…