Can't find how to change highlightcolor parameter with unfolding

edited October 2016 in Library Questions

Hi, In a sketch I display map using unfolding. I added countries by following example ChloroplethMapApp. What I can't do is to change the color (by default a big red) of the country selected with my mouse. Please can someone explain how to change the hightlightColor parameter ? Thank you very much.

Answers

  • Hi,

    Can someone explain how to use this method : setHighlightColor(int highlightColor) This method would allow me to change the color of a marker selected with the mouse .

    I don't understand how this unfolding's method works.

    Thank you.

  • @fabwoj, I'm not personally familiar with unfolding, but it is sometimes difficult for forum members to help you without having more concrete details of your problem. If you can, please post a minimal, complete example sketch (MCVE) showing what you have tried to do with e.g. ChloroplethMapApp, and what is happening instead.

    If you have something more concrete to debug perhaps @kfrajer might have a suggestion?

  • Hi Jeremy, I finally found a complicated way to modify the color and stroke of a selected marker (polygon for me) on my map. I spent many hours to do this but I learned a lot on this library.So... I asked Till Nagel if there was an easy way to do this job. Will see...

    Who is kfrajer ?

    Thank you
    Have a good day !

  • @fabwoj -- Glad to hear it is working. If you have an example of your custom selection marker solution that might help future users, please share!

    @kfrajer is an active forum member who I happened to notice has answered a number of previous unfolding maps forum questions.

  • Hi, Here is Till 's answer to my problem :

    ((AbstractMarker) marker).setHighlightColor(color(0, 255, 0,75)); ((AbstractMarker) marker).setHighlightStrokeColor(color(0, 255, 0,75));

    It was obsious...pfff

  • it was obvious not obsious !

  • @fabwoj thank you so much for sharing your answer!

  • @fabwoj What unfolding map version are you using? Are you running processing 2 or 3?

    I was checking the example available in unfolding maps (Processing 3.1.2 and Unfolding_for_processing_0.9.8beta) and they use the following call to select the highlight color for markers:

    marker.setColor(color(255, 255, 0, transparency));

    Here I am using yellow and it worked. Now, my version of ChloroplethMapApp doesn't choose countries using mouse actions.

    Kf

  • Hi Kf, The old version of ChloroplethMapApp doesn't choose the countries using mouse actions neither. I was wrong. Sorry. But MarkerSelectionApp does... And if you want to change the highlightcolor you must use : ((AbstractMarker) marker).setHighlightColor(color(0, 255, 0,75));

    I'am using Unfolding_for_processing_0.9.6 Till said he fixes this problem. With the next version you should use marker.setHighlightColor(color(0, 255, 0,75));

    Have a good day, Fabrice

Sign In or Register to comment.