Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

Reply
Member
dajvid
Posts: 4
Registered: ‎04-11-2012
Message 1 of 2 (918 Views)
Accepted Solution

"Flexible Web Layout Example 2: Selections" generates error

918 Views, 1 Replies
02-28-2013 02:18 AM

Hi,

 

I'm testing "Example 2: Selections" in the "Flexible Web Layout Examples":

 

http://wikihelp.autodesk.com/Infr._Map_Server/enu/2013/Help/0005-Develope0/0105-Flexible105/0112-Exa...

 

Testing the Example2.js provided, a javascript error is generated on the following line:

 

var oSelection = selection[theMap.getMapName()];

The error generated is:

 

Fusion Error:
WARNING: Exception occurred in AJAX callback.
Message: getMapName is not a function

 

The same code appears in 

 

http://wikihelp.autodesk.com/Infr._Map_Server/enu/2013/Help/0005-Develope0/0094-Flexible94/0100-Work...

 

What is the correct code for working with selections?

 

Kind regards,
Dave.

Valued Mentor
jackie.ng
Posts: 273
Registered: ‎10-06-2008
Message 2 of 2 (882 Views)

Re: "Flexible Web Layout Example 2: Selections" generates error

03-03-2013 04:41 PM in reply to: dajvid

Oh dear! Someone changed the API and failed to document this!

 

Anyway, here's how you can get the map name.

 

//Gets the MapGuide map name from the map widget
//
//theMap: The Fusion.Widget.Map instance
function getMapName(theMap) {
//subMaps will be an array of Fusion.Layers instances (of which Fusion.Layers.MapGuide is a subclass of) var subMaps = theMap.getAllMaps(); for (var i = 0; i < subMaps.length; i++) { if (subMaps[i].arch == "MapGuide") { //Is a Fusion.Layers.MapGuide object return subMaps[i].getMapName(); //Map name is here } } return null; }

Unless you have some strange multi-map setup, the subMaps array will generally have at most one Fusion.Layers.MapGuide instance, so you just find that instance (using the .arch property to determine the correct sub-type) and get the map name from that instance.

 

 - Jackie

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community