Sign in to follow this  
Alex81

Fusionamaps And Openlaszlo(Flash 9)

Recommended Posts

I'm trying to integrate fusionmaps into test OpenLaszlo application. Code is pretty simple:

 

<canvas proxied="false" bgcolor="blue">

<view width="750" height="400" id="a"

resource="http:FCMap_World.swf">

</view>

</canvas>

 

Basically what OpenLaszlo framework does it creates stage:Stage->sprite:Sprite->imgLoader:Loader hierarchy and loads swf resource using imgLoader.

The problem is that map is always rendered full screen .OpenLaszlo debugger allows to watch object properties and here is what I can see:

a.sprite.imgLoader.width = 1335;

a.sprite.imgLoader.height = 916;

a.sprite.root.stageWidth = 1235; (width of browser window)

a.sprite.root.stageHeight = 816; (height of browser window)

 

Why does map always occupy even more space than a stage size?

Is there any way I can control size of the map? How can I make it draw 750x400?

 

Thanks,

Alex

Share this post


Link to post
Share on other sites

Sudipto,

 

Initially I used swf file from the FusionMaps_Trial package.

 

Now I tried to replace it with swf file from FusionMapsFlex package and behavior was a little bit different: Data.xml was not requested by default and map was rendered 750x400 with black areas. If I supply xml config (for example add dataXML='<maps/>' request parameter) map again occupies full screen.

 

Then I tried to link FusionMaps.swc an load map using FusionMaps class:

 

<canvas proxied="false">

<view width="750" height="400" id="a">

 

<passthrough>

import com.fusionmaps.components.FusionMaps;

</passthrough>

 

<handler name="oninit"> <![CDATA[

addMap();

]]> </handler>

 

<method name="addMap"> <![CDATA[

var myFirstMap:FusionMaps = new FusionMaps();

myFirstMap.FMMapType = "World";

myFirstMap.FMSetDataXML("<map/>");

this.sprite.addChild(myFirstMap);

//myFirstMap.FMRender();

]]> </method>

</view>

</canvas>

 

 

But this code caused:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at com.fusionmaps.components::FusionMaps/draw()[F:\work\sudipto\_SVN\development\fmflex\fmflex\trunk\core\swc\core\sources\FlexBuilder3\source\com\fusionmaps\components\FusionMaps.as:573]

at com.fusionmaps.components::FusionMaps/stageEnter()[F:\work\sudipto\_SVN\development\fmflex\fmflex\trunk\core\swc\core\sources\FlexBuilder3\source\com\fusionmaps\components\FusionMaps.as:489]

 

Any ideas what is causing this exception?

 

Thanks,

Alex

Share this post


Link to post
Share on other sites

Hi Alex,

 

 

Please note that FusionMaps for Flex doesn't support Open Laszlo, as of now. :(

 

However, you may try doing the following and check if this helps.

1. Use the core maps/charts, i.e, from the FusionCharts core pack (not FusionCharts/FusionMaps for Flex)

 

2. Use query string when loading map/chart SWF as mentioned below.

Ref.- .../FCMap_Asia.swf?mapwidth=750&mapheight=400&dataURL=demoMapData.xml...

 

Hope this helps. :)

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Glad to know that you have managed to resolve your problem.

 

Happy FusionCharting!!! biggrin.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this