Sign in to follow this  
etm

Marker Link Will Not Fire - How to Test...

Recommended Posts

I am trying to create a simple usage of the Worldmap.

If I follow and create an example and attempt to load from an XML file:

64b38db3-0e60-4fbc-b596-6ce6.JPG

 this is what I see on my screen:

3789eb60-fdff-452b-b589-87e2.jpg

If I place the XML inline, I can get the chart; however, I cannot get the MARKER link function to work.  I even wrote a

simple function in which I just try to alert a message.

fdcdc142-6f7c-4d34-8577-4aaf.JPG

My javascript 3e9198c5-b951-49cf-b44d-0926.jpgcode is simple:

And here is the XML:

04fa0e26-f7b5-4230-9227-530a.JPG

Why does the insertion of the file not interpret the XML correctly.  Please note, I removed the link part of the one marker line to verify that was not causing the effect where a portion of the map shows.

What can I do to use inline Javascript and have strings in the function.

So if you have:

link='JAVASCRIPT: loadPg('myStr');' Does not work.

Tried:

var myVar = 'myStr';

Then loading the function as follows:

link='JAVASCRIPT: loadPg(myStr);'

? I'm at my wit's end with this one.

Share this post


Link to post
Share on other sites

Please note, that the XML file does not have this string: map.setDataXML( at the start of the file.  The string was only in my picture, because I had copied it from the web page where I was placing the strings inline while testing.

Share this post


Link to post
Share on other sites

Hi,

Could you please use map.setDataURL("map.xml")  when you like to provide the XML from a file or XML stream?

Could you please check whether you are placing the Map in a frame o iframe which might prevent the javascript function to execute?

Share this post


Link to post
Share on other sites

I applied your XML example for the entity javascript and that works.  I extended that code with the marker code.

I'm still not having any luck with the javascript firing from the marker.  See XML Below:

<map borderColor='005879' fillColor='D7F4FF' numberSuffix=' Mill.' includeValueInLabels='1' labelSepChar=': ' baseFontSize='9'>

<data>

  <entity id='NA' value='515' link="JavaScript:myJS('NA, 515');"/>

  <entity id='SA' value='373' link="JavaScript:myJS('SA, 373');"/>

  <entity id='AS' value='3875' link="JavaScript:myJS('AS, 3875');"/>

  <entity id='EU' value='727' link="JavaScript:myJS('EU, 727');"/>

  <entity id='AF' value='885' link="JavaScript:myJS('AF, 885');"/>

  <entity id='AU' value='32' link="JavaScript:myJS('AU, 32');"/>

</data>

<markers>

<definition>

 <marker id='CAN' x='113.02' y='141' link="JavaScript: loadPg('CAN');" label='Canada' labelPos='left'  />

 <marker id='INC' x='135.52' y='172.5' link="Javascript: loadPg('INC');" label='Houston' labelPos='right'  />

 <marker id='SPL' x='335.02' y='121.5' link="Javascript: loadPg('SPL');" label='United Kingdom'  labelPos='top' />

 <marker id='SIN' x='560.02' y='267' link="Javascript: loadPg('SIN');" label='Singapore' labelPos='bottom'  />

 <marker id='DUB' x='446.02' y='202.5' link="Javascript: loadPg('DUB');" label='Dubai' labelPos='top' />

</definition>

<application>

 <marker id='CAN' shapeId='triangle'  />

 <marker id='INC' shapeId='triangle'  />

 <marker id='SPL' shapeId='triangle'  />

 <marker id='SIN' shapeId='triangle'  />

 <marker id='DUB' shapeId='triangle'  />

</application>

 </markers>

</map>

Share this post


Link to post
Share on other sites

Attached is the debugger code I got by turning on the debugger:

Info: Map loaded and initialized.

Version: 3.0.4

Map Objects:

BACKGROUND

PLOT

LABELS

LEGEND

TOOLTIP

MARKERS

MARKERLABELS

MARKERCONNECTORS

Initial Width: 700

Initial Height: 300

Scale Mode: noScale

Debug Mode: Yes

Application Message Language: EN

INFO: Map registered with external script. DOM Id of map is Map1Id

INFO: XML Data provided using dataURL method.

dataURL provided: map.xml

dataURL invoked: map.xml

XML Data: <map borderColor="005879" fillColor="D7F4FF" numberSuffix=" Mill." includeValueInLabels="1" labelSepChar=": " baseFontSize="9"><data><entity id="NA" value="515" link="JavaScript:myJS('NA, 515');" /><entity id="SA" value="373" link="JavaScript:myJS('SA, 373');" /><entity id="AS" value="3875" link="JavaScript:myJS('AS, 3875');" /><entity id="EU" value="727" link="JavaScript:myJS('EU, 727');" /><entity id="AF" value="885" link="JavaScript:myJS('AF, 885');" /><entity id="AU" value="32" link="JavaScript:myJS('AU, 32');" /></data><markers><definition><marker id="CAN" x="113.02" y="141" link="JavaScript: loadPg('CAN');" label="Canada" labelPos="left" /><marker id="INC" x="135.52" y="172.5" link="Javascript: loadPg('INC');" label="Houston" labelPos="right" /><marker id="SPL" x="335.02" y="121.5" link="Javascript: loadPg('SPL');" label="United Kingdom" labelPos="top" /><marker id="SIN" x="560.02" y="267" link="Javascript: loadPg('SIN');" label="Singapore" labelPos="bottom" /><marker id="DUB" x="446.02" y="202.5" link="Javascript: loadPg('DUB');" label="Dubai" labelPos="top" /></definition><application><marker id="CAN" shapeId="triangle" /><marker id="INC" shapeId="triangle" /><marker id="SPL" shapeId="triangle" /><marker id="SIN" shapeId="triangle" /><marker id="DUB" shapeId="triangle" /></application></markers></map>

Share this post


Link to post
Share on other sites

Resolved.  I was applying the link in the wrong section of the marker XML.  After re-reading the documentation.

Share this post


Link to post
Share on other sites

Hi Admin,

 

We are also trying to implement similar feature in our reports i.e to open a popup when the user clicks on a marker circle. Is this possible? if yes can you please share the syntax. 

I tried giving like 

<marker id="AL" x="485.4" y="284.19" link="JavaScript: loadPg();" label="Test" labelpos="right" />

and,

 function loadPg() {
            alert("hi");
        }
 
but it is not firing anything.
 
please help.

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