Sign in to follow this  
kmorse

Overriding markerBgColor in toolTip and Marker

Recommended Posts

See

 

 

 

http://www.denverpostplus.com/FusionMaps/LiveExamples/PW.html

 

 

 

I want to place two markers on each state. I want the two markers in each state to be different colors (red and blue, for example).

 

 

 

The documentation says, "This attribute lets you set a common background color for all the defined markers on the map. You can later over-ride individual marker colors by using SHAPE definitions." I have tried putting "markerBgColor='(colorcode)'

 

in this line of my code:

 

marker id='CO-Dem' shapeId='circle' markerBgColor='0000FF' toolText='<b>Cand. Votes % Del.</b><BR><b>Clinton</b> 100 50.0 10 <BR><b>Obama </b>50 25.0 5<BR><b>Edwards</b> 50 25.0 5<BR>'/>

 

 

 

But when I refresh the map, there is no difference in the color. I also want to accomplish the same thing with the background color of the tool tip.

 

 

 

Thanks in advance for your help.

 

 

 

Keith Morse

 

Denver Post

Share this post


Link to post
Share on other sites

hi,

Try this :

<map markerBorderColor='000000' markerBgColor='ff0000'  showMarkerToolTip='1'  >

 <data>

 </data>

 <markers>

<definition>

 <marker id='01' x='386.02' y='264' label='InfosoftGlobal'  />

 <marker id='02' x='533.02' y='171' label='FusionCharts'  />

</definition>

<shapes>

<shape id='s1' type='polygon' sides='4' fillColor='0000ff' radius='20' startAngle='90'/>

<shape id='s2' type='polygon' sides='4' fillColor='00ff00' radius='20'/>

  </shapes>

<application>

 <marker id='01' shapeId='s1'  />

 <marker id='02' shapeId='s2'  />

</application>

 </markers>

</map>

Share this post


Link to post
Share on other sites

Thank you for the direction. I now have markers in two colors.

 

 

 

Here is what I did to define the type and color of the marker itself

 

shapes>

 

shape id='s1' type='arc' fillColor='0000FF'/>

 

shape id='s2' type='circle' fillColor='FF0000'/>

 

/shapes>

 

 

 

application>

 

marker id='CO-Dem' shapeId='s1' toolText=' ..... (html and text goes here)

 

marker id='CO-GOP' shapeId='s2' toolText=' ..... (html and text goes here)

 

/application>

 

/markers>

 

 

 

 

 

Now I would like to accomplish the same with the background color of the tool tip. I know that it must be a similar approach but I could not discern from your directions how to apply that to the tool tip background. In my xml file, the styles definition is just below the code I've included above. It looks like this:

 

 

 

styles>

 

definition>

 

style type='animation' name='animX' param='_xscale' start='0' duration='1' />

 

style type='animation' name='animY' param='_yscale' start='0' duration='1' />

 

style name='TTipFont' type='font' isHTML='1' color='FFFFFF' bgColor='0000FF' size='11'/>

 

style name='HTMLFont' type='font' color='333333' borderColor='CCCCCC' bgColor='FF0000'/>

 

style name='myShadow' type='Shadow' distance='1'/>

 

 

 

/definition>

 

 

 

application>

 

apply toObject="PLOT" styles="animX,animY"/>

 

apply toObject='MARKERLABELS' styles='HTMLFont,myShadow' />

 

apply toObject='TOOLTIP' styles='TTipFont' />

 

/application>

 

/styles>

 

/map>

 

 

 

 

 

Thank you in advance for your help.

 

 

 

Keith Morse

 

Denver Post

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