How to capture page with google map?

Posted by Max on Stack Overflow See other posts from Stack Overflow or by Max
Published on 2010-04-01T21:09:48Z Indexed on 2010/04/01 21:13 UTC
Read the original article Hit count: 477

Filed under:
|

I have a UIComponent with Google map in the continer. I need to capture this container for making a preview.

My integration looks like the following:

 <mx:UIComponent id="mapContainer"
        width="410"
        height="300"
    />


 googleMap = new Map();
 mapContainer.addChild(googleMap);

But if I do("this" - is my UIComponent)

var bmd:BitmapData = new BitmapData(this.width, this.height, true, 0x00ffffff);
bmd.draw(this);

I see the following:

An ActionScript error has occurred:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://localhost/ cannot access http://mt1.google.com/vt/lyrs=m@121&hl=en&src=api&x=1&y=1&z=1&s=Gali. No policy files granted access.
    at flash.display::BitmapData/draw()

I now, that I can to add it host to allowed on the custom client. But I need to have working system on any computer )

I've tried to hide it:

templateGoogleMapRenderer.mapContainer.setVisible(false);
templateGoogleMapRenderer.mapContainer.includeInLayout = false;

But it was unsuccessfully.

May be I can override some method in my UIComponent, that flex use during BitmapData/draw() ?

Capture with hidden map is success result for me )

© Stack Overflow or respective owner

Related posts about flex

Related posts about google-maps