I am having an issue with using an overlay on a google map. The overlay works fine initially, but if I choose a different map type (example: Satellite) I lose the overlay.
Is there a way to listen for a map type control click? Or a way to detect when the map type changes?
I want to call a function to reload the overlay when the map type changes.
Any suggestions?
Thanks!
I figured out my problem. I was using a custom map type with tile overlays. When I would click on the default map types, the tile overlay dissappeared. Since the tile overlay was only associated with the custom map type, of course they wouldn’t show up on the default maps because it wasn’t a standard overlay.
So I removed all of the default map types (except one, I can’t figure out how to get rid of them all). Then I created 3 different custom map types with the tile overlays, using the terrain, normal map, and hybrid map types. That fixed my issue.
New issues:
- The hybrid custom map type does not show the roads.
- Can’t figure out why I can’t only show my custom map types on the GMapTypeContol.
Figured out issue #2.
It was an ordering issue. I was removing all of the maptypes first. Then adding the new custom map types.
I changed my code to add my 3 custom map types first, and then remove the google default map types.
I’m assuming it doesn’t allow you to have a maptypecontrol with no map types.