On May 17, 9:42 am, geology_alex <[email protected]> wrote:
> I have a couple of questions about using tile layer overlays
> (GTileLayerOverlay)
>
> I've followed the example code given under "custom map tiles - tile
> layer overlays" 
> athttp://code.google.com/apis/maps/documentation/overlays.html#Tile_Ove...
> and after changing URL's managed to get my own tile layer displaying
> correctly  when the map first loads.
>
> My questions are..
>
> 1) The example above only works when using map.overlay(myTileLayer)
> inside the page onload function (when the map first loads). But i want
> to be able to add the tile layer later (for example from a seperate
> function). What is the best method of doing this?

Make the map variable global, probably.

> 2) In the GTileLayerOverlay section of the API reference, various
> methods such as show() hide() refresh() and zPriority() are listed but
> i'm not sure how these are used. I've tried using
> map.hide(MyTileLayer); within a seperate function to test this but
> without success i'm sure im doing something wrong!?

You probably are. How are we to tell for certain?

If you want to hide a GTileLayerOverlay, you need to retain a
reference to the overlay and then hide that:
var myOverlay = new GTileLayerOverlay(...);
myOverlay.hide();
http://code.google.com/apis/maps/documentation/reference.html#GTileLayerOverlay

Please post a link. It makes things far easier.

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

Reply via email to