pamela,

your getAlpha override idea works, but does not meet my needs.  the
user needs to be able to modify the alpha of the layer dynamically
with a control.  the getAlpha override only sets the alpha for the
layer once and cant be then modified.

my preferred solution is to use your original "addOverlay" idea so i
can direct control the foreground.alpha property.  but i was unable to
make your example work.

i was able to add my custom TileLayer as overlay 1.  that worked
fine.  but when i added "MapType.HYBRID_MAP_TYPE.getTileLayers()
[1]" (the street layer) as a second overlay it failed to show up.

i think that the problem is with how i set up the MapType for the
map.  here is my code.  what am i doing wrong?


        map.addMapType(MapType.SATELLITE_MAP_TYPE);
        map.setMapType(MapType.SATELLITE_MAP_TYPE);

        var customLayerOverlay:TileLayerOverlay = new TileLayerOverlay(new
CustomTileLayer());
        var streetLayerOverlay:TileLayerOverlay = new TileLayerOverlay
(MapType.HYBRID_MAP_TYPE.getTileLayers()[1]);

        map.addOverlay(customLayerOverlay);
        map.addOverlay(streetLayerOverlay);



On May 9, 6:43 pm, pamela fox <[email protected]> wrote:
> You should be able to change the getAlpha of the TileLayer function to
> return a variable opacity based on user 
> input:http://code.google.com/apis/maps/documentation/flash/reference.html#T...
>
> On Fri, May 8, 2009 at 3:49 PM, pphhiilllliipp <[email protected]> 
> wrote:
>
> > Thanks Pamela!  I started from your code and the Lynx map and put it
> > together with the basicflashexamplelike the below.
>
> > One further question, how can I adjust the alpha of mycustomtile
> > layer after it has been created?  Can I access some display object or
> > foreground property of the tile layer so that the user can adjust
> > alpha with some buttons?  looking for code like: tileLayers[1].setAlpha
> > (.5);
>
> > Here's the result of my test in progress, by the 
> > wayhttp://www.phillippond.com/mp
> > For now its using the Lynx map's tiles, so you've got to go to
> > Tasmania to see it.
> > Phillip
>
> > import com.google.maps.LatLng;
> > import com.google.maps.Map;
> > import com.google.maps.MapEvent;
> > import com.google.maps.MapType;
> > import mannahatta.*;
>
> > var map:Map = new Map();
> > map.key =
> > "ABQIAAAA-8ZzjqcfxFyZOipI85E4PBRN9D3T7p8XCefiKX6nnmQbxMyh1hTbw6ykiaJNFdSZCo-
> > UJXuqmd3Nkg";
> > map.setSize(new Point(stage.stageWidth, stage.stageHeight));
> > map.addEventListener(MapEvent.MAP_READY, onMapReady);
> > this.addChild(map);
>
> > function onMapReady(event:Event):void {
> >        /*      HYBRID_MAP_TYPE has default layers
> >                0: Satellite
> >                1: Streets, Labels
> >       */
> >        // Setup TileLayers in desired Z order
> >        var manLayer:MannahattaTileLayer = new MannahattaTileLayer();
> >        var tileLayers:Array = new Array();
> >        tileLayers[0] = MapType.HYBRID_MAP_TYPE.getTileLayers()[0];
> >        tileLayers[1] = manLayer;
> >        tileLayers[2] = MapType.HYBRID_MAP_TYPE.getTileLayers()[1];
> >        // Create MapType
> >        var mannahattaMapType:MapType  = new MapType(tileLayers,
> > MapType.HYBRID_MAP_TYPE.getProjection(),"mannahattaMapType");
> >        map.addMapType(mannahattaMapType);
> >    map.setMapType(mannahattaMapType);
> > }
>
> > On Apr 5, 3:44 am, pamela fox <[email protected]> wrote:
> >> Hi Phillip-
> >> I would recommend using TileLayerOverlay for the second two layers. After
> >> creating the map type, use code like:
>
> >>  var hybridTileLayers = MapType.HYBRID_MAP_TYPE.getTileLayers();
> >> var customTileLayerOverlay = new TileLayerOverlay(new CustomTileLayer(),
> >> 256, map.MERCATOR_PROJECTION);
> >> map.addOverlay(customTileLayerOverlay);
> >> map.addOverlay(hybridTileLayers[1]);
>
> >> A few examples ofcustomTileLayer code are in the demo 
> >> gallery:http://code.google.com/apis/maps/documentation/flash/demogallery.html......
>
> >>  - pamela
>
> >> On Thu, Apr 2, 2009 at 1:12 PM, CaptainHudson 
> >> <[email protected]>wrote:
>
> >> > Can someone point me in the right direction for some research or a
> >> > good .flaexamplefile of a map withcustomtiles?  I'm not actually
> >> > sure if that is even what to call the thing I need.  To describe it
> >> > with two more specific requirements:
> >> > 1. I'm looking for aflashexample(not flex) for building a map with
> >> >customtile layers
> >> > 2. What is the correct terminology (customtile layer,
> >> > tileLayerOverlay, customOverlay ?) for the following scenario:
> >> > - acustommap of SATELLITE_MAP_TYPE (I created acustomsimply
> >> > because I need to limit the zoom levels)
> >> > - with a layer ofcustomtiles on top of this ( I need to be able to
> >> > control transparency of this layer for the interactive objectives)
> >> > - with the street map (google's) on top of this
>
> >> > thanks
> >> > Phillip
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" 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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to