[Google Maps API v3] Using transparent Google streets overlay on top of custom tile layer

251 views
Skip to first unread message

Walt Rice

unread,
May 4, 2010, 9:39:08 AM5/4/10
to Google Maps JavaScript API v3
I'm trying to get a mashup that works well in v2 working to some
extent on mobile devices using v3.

V2 working: http://www.philageohistory.org/tiles/viewer/
V3 start (messy): http://www.philageohistory.org/tiles/mobile/

If I am displaying a custom ImageMapType tile layer, how can I overlay
streets, ala the Hybrid mode, with streets on top of aerials?

In v2, I could stack layers in a GMapType, and grab the second layer
of the G_HYBRID_MAP type to use in my own map type.

<code>var LUMHybridLayers = [tileLUM,G_HYBRID_MAP.getTileLayers()
[1]];</code>

I'm figuring I need to add the streets as an overlay, but how do I get
access to that specific tile layer MapType in the v3 API? I don't
want the aerial photos with it, just the streets to overlay on my own
maps.

Thanks,
Walt

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Walt Rice

unread,
May 4, 2010, 10:50:06 AM5/4/10
to Google Maps JavaScript API v3
I think I found a solution after two days of searching, answer is
here:
http://koti.mbnet.fi/ojalesa/v3/osm_dual.htm

You can make a tile layer that directly references the Google images
for that overlay.

var tileHybridLabels = new google.maps.ImageMapType({
getTileUrl: function(ll, z) {
var X = ll.x % (1 << z); // wrap
return "http://mt0.google.com/vt/v=apt.116&hl=en-US&x="
+ X + "&y=" + ll.y + "&z=" + z + "&s=G&lyrs=h";
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
maxZoom: 20,
name: "lyrs=h",
alt: "Hybrid labels"
});

And then add it as an overlay to the map.
Reply all
Reply to author
Forward
0 new messages