Google Maps and ARK

From ARK
Revision as of 12:50, 27 October 2009 by Stuarteve (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What is Google Maps?

Google Maps are one of the leading online mapping providers. They allow their mapping to be used in other applications via an API

GMaps and ARK

As of v0.7 ARK supports using GMaps as a baselayer in all of the mapping. It is very easy to turn this on, but you should take note of the points below before you do it.

Setting It Up

As GMaps operate under a license, you will first need to apply for an API key. This is easy enough - just go to:

GMaps API Sign Up Page

Once you have completed the signup you will be given a few chunks of code. Copy and paste the Javascript API code into your settings.php file, like this:

 $gmap_api_key =  '<script src="http://maps.google.com/maps?file=api&v=2&sensor=true_or_false&key=YOUR_UNIQUE KEY_WILL BE_HERE" type="text/javascript"></script>';

Please note that you should remove the 'sensor=true_or_false&' section of the URL.

Once thats in your settings your maps should be using GMaps as their background.


Things to note

  • Currently if you use GMap data, you will not be able to use any other WMS layers for your map. Therefore GMap has to be your one and only base layer. The mapping code will ignore your '$wms_layers' array. This may be changed in future versions of ARK.
  • GMap data only really works well with mapping data in EPSG:4326 (WGS84 Lat/Longs) or EPSG:27700 (British National Grid). If you are using other projections (such as UTMs, etc.) you may run into problems with your data not being projected in the right place.