I have GeoServer layers that need to be used via Google-Maps-type
tiles by an application using the Google Maps API (ultimately, our NVS
application, http://nvs.nanoos.org); I believe it's v2 API, but I'm
not the GM developer -- and the GM developer has never used
GeoServer/GWC tiles. I do maintain and manage GeoServer. I'm using the
latest stable GeoServer, 2.1.1, via a WAR installation on Tomcat6 on
Ubuntu 10.04.
I've tested WMS access and GeoWebCache tile access using a simple
OpenLayers example:
http://habu.apl.washington.edu/mayorga/crb/crbnvs_gislayers_test5.html
Everything works. This GM-style tile request works in OpenLayers:
var gs_wtsh_wms = new OpenLayers.Layer.XYZ( "CRB Watersheds GMAP Tiles",
"http://habu.apl.washington.edu/geoserver/gwc/service/gmaps?layers=crb:crb_sub_watersheds&zoom=${z}&x=${x}&y=${y}&format=image/png",
{'sphericalMercator': true, 'isBaseLayer':false} );
According to http://geowebcache.org/docs/current/services/gmaps.html
something very similar should work in the Google Maps API. But we
can't get it to work!
I've tested a sample URL request on Firefox, like this:
http://habu.apl.washington.edu/geoserver/gwc/service/gmaps?layers=crb:crb_sub_watersheds&zoom=9&x=151&y=196&format=image/png
It doesn't return an error. It seems to return a blank 256x256 png
image. But I also can't see an entry on the GeoServer log when I issue
this request! That seems very weird.
The Google Maps requests throw errors on the GeoServer log like this:
2011-07-29 04:03:13,629 ERROR [geowebcache.GeoWebCacheDispatcher]
- Unable to determine requested format, image/png?rand_gmap=14639
http://habu.apl.washington.edu/geoserver/gwc/service/gmaps
Any clues?
Thanks!! Cheers,
-Emilio Mayorga
UW/APL/NANOOS
Thanks if you were already thinking about this... Cheers,
-Emilio
Here's how you'd do this in V3 in case you're interested (excluding
options like adding a copyright notice, and so forth):
----
var fooLayer = new google.maps.ImageMapType({
getTileUrl: function(ll, z) {
return "http://habu.apl.washington.edu/geoserver/gwc/service/gmaps?layers=crb:crb_sub_watersheds&format=image/png&zoom="
+ z + "&x=" + ll.x + "&y=" + ll.y;
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
maxZoom: 18,
name: "Foo",
alt: "Foo Layer"
});
map.overlayMapTypes.push(fooLayer);
-----------
Cheers,
-Josh
> --
> You received this message because you are subscribed to the Google Groups "Cascadia Users of Geospatial Open Source" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cugos+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cugos?hl=en.
>
>
Thanks for the tip and sample. They will be useful as we plan the
transition to GM v3.
Cheers,
-Emilio