pitommasi

[More Than Urgent!] Get Coloring Range In Javascript

Recommended Posts

Guest Angshu

Hi,

 

Could you please elaborate your query a little bit more?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

let's say taht I have a map XML with the following color ranges defined:

 

 <colorRange>	
  	<color minValue='120000000' maxValue='250000000' color='ccfcfc' displayValue='over 120.000.000' />
	<color minValue='100000001' maxValue='120000000' color='ffffaa' displayValue='100.000.001 - 120.000.000' />
	<color minValue='50000001' maxValue='100000000'  color='ffaaff' displayValue='50.000.001 - 100.000.000' />
	<color minValue='30000001' maxValue='50000000' color='aaaaff' displayValue='30.000.001 - 50.000.000' />
	<color minValue='10000001' maxValue='30000000' color='aaffaa' displayValue='10.000.001 - 30.000.000' />
	<color minValue='5000001' maxValue='10000000' color='ffaaaa' displayValue='5.000.001 - 10.000.000' />
	<color minValue='2000000' maxValue='5000000' color='ff8888' displayValue='2.000.000 - 5.000.000' />
	<color minValue='1' maxValue='2000000' color='ff1111' displayValue='under 2.000.000' />
	<color minValue='0' maxValue='0' color='A3551A' displayValue='' />
  </colorRange>

 

how can I read this at runtime in javascript?

I want to compile a text list of colors, like:

 

                      	'cb00fe' = over 120.000.000

                     	'ffffaa' = 100.000.001 - 120.000.000

                     	'ffaaff' = 50.000.001 - 100.000.000

                     	'aaaaff' = 30.000.001 - 50.000.000

                     	'daff4b' = 10.000.001 - 30.000.000

                     	'5555ff' = 5.000.001 - 10.000.000

                     	'ff8888' = 2.000.000 - 5.000.000

                     	'ff1111' = under 2.000.000

                     	'95FBE7' = 0 

 

but, AT RUNTIME, as colors might change

Edited by pitommasi

Share this post


Link to post
Share on other sites

Hi,

 

You can not set color range directly using JavaScript API. If you have a JavaScript store which contains the colors and value ranges, you would need to build the XML for the map and pass it to the map.

 

To provide data, settings, color range, markers, connectors, cosmetics, formatting in FusionMaps, you would always (as of now) need to build XML and pass it to the map.

Share this post


Link to post
Share on other sites

how can I read this at runtime in javascript?

If you read carefully, I have written "read", not set!!!

I want to know in javascript which color range has been set into the loaded XML...

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