How do I take a snapshot of the map image provided through ModestMaps library?
How do I resolve take a snapshot of the map image provided through ModestMaps library? I tried using the ImageSnapshot.captureImage function, but got the following error:
SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: http://localhost:9080/.......swf cannot access
http://us.maps2.yimg.com/us.png.maps.... A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::BitmapData/draw()
at mx.graphics::ImageSnapshot$/captureBitmapData()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:188]
at mx.graphics::ImageSnapshot$/captureImage()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:282]
SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: http://localhost:9080/enpt/ENPTGui/EN... cannot access
http://us.maps2.yimg.com/us.png.maps.... A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::BitmapData/draw()
at mx.graphics::ImageSnapshot$/captureBitmapData()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:188]
at mx.graphics::ImageSnapshot$/captureImage()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:282]
SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: http://localhost:9080/.......swf cannot access
http://us.maps2.yimg.com/us.png.maps.... A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::BitmapData/draw()
at mx.graphics::ImageSnapshot$/captureBitmapData()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:188]
at mx.graphics::ImageSnapshot$/captureImage()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:282]
SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: http://localhost:9080/enpt/ENPTGui/EN... cannot access
http://us.maps2.yimg.com/us.png.maps.... A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::BitmapData/draw()
at mx.graphics::ImageSnapshot$/captureBitmapData()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:188]
at mx.graphics::ImageSnapshot$/captureImage()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\graphics\ImageSnapshot.as:282]
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?In Flash, it depends which MapProvider you're using - in this case it looks like Yahoo doesn't have a crossdomain.xml file on their tile servers that grants permission to manipulate the data in their map images. This means that you can't grab pixels or areas from the images (or enable the smooth setting on the bitmap).
http://livedocs.adobe.com/flash/9.0/m...
There's no way around this in Flash alone, but depending on what you're trying to do you might try Yahoo's static map image API or the Modest Maps python code. The latter can glue map images together on a server and might help you do what you need to do.
http://modestmaps.com/examples-python...
http://developer.yahoo.com/maps/rest/V1/
-
Inappropriate?If the map tiles appear to come from the same domain as your Flash application then Flash will allow you to take a bitmap of the map tiles.
I’m frustrated
-
Inappropriate?Would it work if you set up a web service on the same domain of your flash application that takes the same parameters than yahoo, get the map from yahoo and return this to the flash ?
-
Yes, that would work. You can use the Modest Maps python code to do things like this using a similar format for map providers.
Loading Profile...



EMPLOYEE

