[OpenLayers-Users] Google Maps as an overlay

Brent Pedersen bpederse at gmail.com
Sat Feb 24 22:14:18 EST 2007


i think you'd have to add an addMapType to the Google.js in openlayers.

if you go to this site (i see you have included his .js)
http://chignik.berkeley.edu/google/wmstest236.html

and run this chunk of javascript in firebug:
var layer4=[tileDoq,G_HYBRID_MAP.getTileLayers()[1]];
var custommap4 = new GMapType(layer4, G_SATELLITE_MAP.getProjection(),
"Map 4", G_SATELLITE_MAP);
map.addMapType(custommap4);
map.setMapType(custommap4);

you can see the effect hybrid overlaid.
so in order to do that, you have to do an addMapType() first.
so **i think** you could add code in Google.js that checks if the
type:  is one of google's 3 [roads/hybrid/satellite] and if it is not,
then it would have to do map.addMapType(newType).
then your code could work....

-brent



On 2/24/07, bradleyspencer <brad at cubewerx.com.au> wrote:
>
>
>
>
> I have had no problems using G_HYBRID_MAP for a base layer in OpenLayers.
> However, when using Google Maps you can access the HYBRID roads separately
> from the satellite imagery
> (G_HYBRID_MAP.getTileLayers()[1]) if you want to overlay
> the roads and text on top of your custom overlay. In my application I want
> to overlay semi-translucent SLD-rendered demographic layers on top of a
> GoogleMaps base; then I want to overlay these HYBRID roads only so that they
> are more readable. But when I try to sandwich my layer between the two
> google layers it does not display any google layers and the hybrid overlay
> is greyed out in the layerswitcher.
>
>
>
> Can anyone suggest how I could make the HYBRID layer (roads only) an overlay
> on OpenLayers?
>
>
>
> See http://demo.cubewerx.com.au/DemoDrapes.html
>
>
>
>
>
> Cheers,
>
>
>
> Brad….
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>



More information about the Users mailing list