ArthurGuibert / FSInteractiveMap

A charting library to visualize and interact with a vector map on iOS. It's like Geochart but for iOS!
Apache License 2.0
550 stars 80 forks source link

Question about coloring U.S. states #6

Open hjouhi opened 8 years ago

hjouhi commented 8 years ago

First off - great functionality, thank you a lot for sharing!

One question: how can I color certain states (example 3) programmatically without the need to click on them? E.g., if I have a changing variable "isSunny" for each state (to indicate whether it is sunny in its capital at that time) and I would like to color the state green or red based on whether isSunny is 1 or 0.

I notice that inside "map setClickHandler:^(NSString* identifier, CAShapeLayer* layer){" of -(void)initExample2 I can write, e.g., "layer.fillColor = [UIColor redColor].CGColor;" to color the clicked state red - but how can I do this without clicking? I.e., I guess the key detail I'm missing is how can I refer to a state's identifier and use that to color the state?

kk143g commented 7 years ago

Did you get your answer? I also need