Tip of the Day – Check the Code

Some of the most popular pages on GISDoctor.com (shameless self-plug) are those that provide examples of how to read WMS data into Google Map applications from a number of sources including ArcGIS Server, OpenLayers, and MapServer.  People take the code from these pages, embed the scripts into their own applications, make some modifications, and publish their own mash-ups.  I think this is awesome and I encourage it on the pages themselves.  I’ve seen a few good applications of this code and I hope more come in the future.

However, I need you, the mash-up artist, to make sure you do one little thing when copying the code into your own applications. Do not copy the Google Analytics code into your own page.  This is the last two blocks of script at the end of each page.  To aid the user I have included a comment to remind them to not to include the Google Analytics script in their application.

Thanks!

A few times a week I notice pages that have used the code from GISDoctor.com (second plug of the post) that still include my Google Analytics information.  Most of the time the user will eventually remove the code or embed their own tracking info, but there are hold-outs.  I’m talking about you, person in Spain.

Thanks, and happy GIS-ing!

Transparency Slider Page Updated

One of the biggest traffic drivers to my site, according to Google Analytics, are people interested in using a transparency slider for use in Google Map Mash-Ups.  With this in mind I gave a quick update to my current transparency slider page that was inspired by a project by Klokan Petr Pridal.  He has done a lot of great work in regards to the use of outside data sources in Google Maps.  The demos on his website have been used in countless mash-ups. If you have a few minutes check it out.

The updated page uses a USGS topographic map layer from Microsoft Research Maps and overlays it over a Google Map.  The Microsoft Research topo maps have a quirky loading scheme, which may leave a tile empty, every now and then.  Once the user pans or zooms on the map the tiles reload and everything should be in view.  Again, I’m not helping my position in my previous post. This code was originally developed using the V2 lineage of the Google Maps API, which has since been depreciated.

When I get some time this weekend I’ll update the code to work with V3.  Only a year after V3 debuted…

In Defense of the WMS

Earlier this week James Fee, celebrity GIS blogger (seriously, how many other GIS bloggers can you name), posted a blog about the death of the WMS.  He was commenting on a blog from Sophia Parafina, who was discussing the difficulties of working with the WMS URL.  Surprisingly enough, this isn’t the first time someone has shared their  “love” of the WMS standard.

If you have programmed using a WMS you probably have become frustrated when trying to understand what each component of the URL means, the differences between the different versions, and how different GIS server software handles the WMS.  I don’t think the WMS is dead, but its use may need to be reevaluated.  For example,  the WMS servers that I take advantage of tend to have few datasets (less than 30) served from them, and I only use raster datasets, such as historical maps, or aerial photography, in my applications.  I try to avoid large WMS servers with 100s of layers, and I rarely use vector from them, because I don’t like wait times with large WMS servers, and vector data renders poorly.

I like to use WMS data from a number of different sources as base maps for use in Google map mash-ups.  I’ve found that using the WMS for this purpose equals fast response times in an easy to use interface.  Now, what about decoding the URL?  Well, it took a couple of hours of trial and error but a few lines of javascript can read the WMS URL pretty easily.  I didn’t create the code myself, but like any programmer, I definitely had help from a number of different online sources.

Here are a few Google Maps V3 API examples running WMS data:

ArcGIS Server WMS in Google Maps

Open Layers WMS in Google Maps

Cadcorp WMS Google Maps

Microsoft Research Maps in Google Maps

Multiple WMS Service in a Single Site

Large Aerial Photography Datasets

That’s all for today!  Hooray weekend!

p.s., For my next post I’ll try to have a couple of pictures.  People hate reading.