[Papervision3D] bitmap.draw with google maps

Andy Zupko azupko at zupko.info
Sat Jun 6 18:37:42 PDT 2009


Welcome to flash security!  The only way you can get around it is to  
host your own tiled images since i'm pretty sure google maps doesn't  
have a crossdomain allowing you access to draw.  If you do that you  
will need to use a 3rd party mapping API since i'm also pretty sure  
google maps doesn't support custom tiles...  the only one i have  
personally worked with is UMap: http://www.afcomponents.com/components/umap_as3/

hope that helps.




On Jun 6, 2009, at 12:06 PM, eric mcconkie wrote:

> ok, i have an error i have reasearched for a good 10 hours now. I  
> have to take it to the boards. I am importing the google map api  
> into mc's. I then add the mcs to Papervision as  a MovieMaterial.  
> Finally, the material is added to a cube, where then some crazy math  
> occurs to position each 'tile' in a sudo map like structure. The  
> issue i am having is getting the maps to cooperate with PVs  
> bitmap.draw methods. Is there a known work around to this? some way  
> i can get the maps to be redrawn? it works on my local build (on  
> compile) but now when accessed via http. ugh.
>
> the core methods in my class are like so:
>
> private function _startMap() : void
> {
>     mc = newGoogleMap();
>     mc.visible=false;
>     mc.x = -2000;
>     MapLab.instance.addChild(mc);
>     make3D();
> }
>
> private function make3D() : void
> {
>
>     var mm:MovieMaterial = new  MovieMaterial(mc,false,true,true,new  
> Rectangle(0,0,mc.width,mc.height));
>     mm.doubleSided = false;
>     mm.interactive= true;
>     mm.animated = true;
>     //mm.allowAutoResize = false;
>
>     var lt:Object = MapLab.instance.light;
>     var gm:GouraudMaterial = new  
> GouraudMaterial(lt.light,lt.color,lt.ambient);
>     gm.doubleSided = false;
>     gm.interactive = true;
>     var mList:MaterialsList = new MaterialsList();
>     mList.addMaterial(gm,'all');
>     mList.addMaterial(mm,'back');
>
>     var c:Cube = new Cube(mList,mc.width,10,mc.height)
>     addChild(c)
>     c.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK,onClick);
> }
>
> private function geoCode() : void
> {
>     var gc:ClientGeocoder = new ClientGeocoder();
>     gc.addEventListener(GeocodingEvent.GEOCODING_SUCCESS,onGeoCode);
>     gc.addEventListener(GeocodingEvent.GEOCODING_FAILURE,onGeoFail);
>
>     if(this.location != undefined)
>     {
>         gc.geocode(this.location);
>     }else
>     {
>         this.visible = false;
>     }
> }
>
> private function onClick(e:InteractiveScene3DEvent) : void
> {
>
>     var ev:MapEvent3D = new MapEvent3D(MapEvent3D.CLICK)
>     dispatchEvent(ev);
> }
>
> private function preset(e:MapEvent):void
> {
>     var myMapOptions:MapOptions = new MapOptions();
>         this.map.setInitOptions(myMapOptions);
> }
>
> private function onMapReady(event:MapEvent):void
> {
>       geoCode();
>
> }
>
> private function onGeoCode(e:GeocodingEvent) : void
> {
>      
> map 
> .setCenter 
> (e 
> .response 
> .placemarks 
> [0].point,Number(dataObject.zoom),MapType.SATELLITE_MAP_TYPE);
>     this.latlng = e.response.placemarks[0].point as LatLng;
>
>     var mapOb:Object = new Object()
>     mapOb.latLng =  this.latlng;
>     MonsterDebugger.trace(this,this,0xff0000,true);
>     dispatchEvent(new MapEvent3D(MapEvent3D.LOCATE,mapOb)) ;
> }
>
> private function onGeoFail(e:GeocodingEvent) : void
> {
>     trace(dataObject.location +"  is NOT loading as a geocode");
>     dispatchEvent(new MapEvent3D(MapEvent3D.DIE));
> }
>
>
> private function newGoogleMap() : MovieClip
> {
>     mc = new MovieClip();
>     map = new Map();
>     map.key = String(MapLab.instance.googleKey);
>
>     map.addEventListener(MapEvent.MAP_PREINITIALIZE,preset)
>     map.addEventListener(MapEvent.MAP_READY, onMapReady);
>     mc.addChild(map);
>     return mc;
> }
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090606/45ed86aa/attachment.html>


More information about the Papervision3D mailing list