Thursday, February 23, 2006

Layerwing WMS services with GoogleMaps >= v2.36

With the change in code in the Google Maps API v2.36, some things broke in my previous post about how to do WMS layering in V2 of Google Maps. I've posted a working sample of the WMS code for v2.36 and up here.

NOTE #1 (June 9th, 2006): I deleted the code references in the blog and instead point people to the sample link above, where a working version of the code is maintained (the key component is the file called wms236.js).

NOTE #2 (June 9th, 2006): Thanks to Guilhem Vellut for fixing up some Javascript code to make the Mercator Projection work more accurately. Now, it can be used at all zoom levels.

Attributions:
->Mike Williams http://www.econym.demon.co.uk/googlemaps2/ V2 Reference & custommap code

->Brian Flood http://www.spatialdatalogic.com/cs/blogs/brian_flood/archive/2005/07/11/39.aspx V1 WMS code

->Kyle Mulka http://blog.kylemulka.com/?p=287 V1 WMS code modifications

->http://search.cpan.org/src/RRWO/GPS-Lowrance-0.31/lib/Geo/Coordinates/MercatorMeters.pm

->Modified by Chris Holmes, TOPP to work by default with GeoServer.

->Guilhem Vellut for more accurate Javascript Mercator Fxn

3 comments:

Anonymous said...

good stuff John, I just got back into GMaps and WMS. This is clearly the update I need :)

cheers
brian

Anonymous said...

fyi - you should also add the "&reaspect=false" to the url to deal with some WMS servers.

Anonymous said...

Thank you for keeping this updated - it's incredibly useful.