Hi Marco-

Ah, I see. You want to set the color before the API is even loaded in.
This is not possible at the time.

A suggested workaround would be to initially set visible="false" on
the Map component, then set it to "true" after the preinit event. Then
the background color would be whatever was shown instead of the hidden
map component.

If this is not satisfactory for you needs, please file a feature
request in the issue tracker. Thanks!

- pamela

On Thu, Jan 8, 2009 at 7:52 PM, Marco Plebani <[email protected]> wrote:
> Pamela,
> thanks a lot for your reply. I already read this article. With this
> InitOptions, the background is set in a second step. One the frame is
> created, its background is gray.
> After that, the bgcolor change to the color in the backgroundFillStyle. Then
> the map is loaded on this new bg. The problem persist. Probably the color is
> set in a non accessible previous state.
>
> This is the code I use:
>
> <maps:Map id="map" mapevent_mappreinitialize="onMapPreinitialize(event)"
> mapevent_mapready="{onMapReady(event)}">
>
> private function onMapReady(event:Event):void {
>                 map.addControl(new ZoomControl());
>                 map.addControl(new PositionControl());
>                 map.openInfoWindow(new LatLng(42.528156,-9.759271), new
> InfoWindowOptions({contentHTML: "<font face='Verdana' size='12'><b>Ron -
> Italia<br/></font>", hasCloseButton:true}));
>             }
>
> private function onMapPreinitialize(event:Event):void {
>
>                 var opts:MapOptions = new MapOptions();
>                 opts.mapType = MapType.NORMAL_MAP_TYPE;
>                 opts.center = new LatLng(42.528156,-9.759271);
>                 opts.zoom = 8;
>                 opts.backgroundFillStyle = new FillStyle();
>                 opts.backgroundFillStyle.color = 0xFFFFFF;
>                 this.map.setInitOptions(opts);
>
>             }
>
> Cheers
> -- Marco
>
> On Thu, Jan 8, 2009 at 3:14 AM, pamela (Google Employee)
> <[email protected]> wrote:
>>
>> Hi Marco-
>>
>> Yes, use the preinit event with setInitOptions. See:
>>
>> http://code.google.com/apis/maps/documentation/flash/reference.html#MapOptions.backgroundFillStyle
>>
>> The sky demo in the gallery uses a black background.
>>
>> - pamela
>>
>> On Thu, Jan 8, 2009 at 2:23 AM, mplebani <[email protected]> wrote:
>> >
>> > Hi!
>> > I am integrating GMaps inside a flex site. This site is not available
>> > yet.
>> > When the Map component is loaded in my application it has a gray
>> > default background. There is a way to change this color?
>> >
>> > -- Marco
>> > >
>> >
>>
>>
>
>
>
> --
>
> Marco Plebani
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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