• Resolved totorosk8

    (@totorosk8)


    Hi, i’m trying to change the opacity on mouseover but i can’t manage to do it.
    If i put the fillOpacity in my shortcode i change the overall opacity of my map and not simply when hovering over a specific area (in this case a prefecture). Here is my code :
    [leaflet-map address="Tokyo, Japan" zoom=6 doubleClickZoom=true scrollwheel=true fitbounds=1 tileurl=""]
    [leaflet-geojson src="/uploads/japan-prefectures.geojson" color="#ffffff" fillOpacity= "0.3" fillColor="#1eae00" weight="0.8" popup_text="{name}"][/leaflet-geojson][hover]
    [zoomhomemap]

    Thanks
    edit: i tried with someting like this but i don’t see the changes :
    [hover opacity=0.8 fillOpacity=1]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor hupe13

    (@hupe13)

    Is the space between fillOpacity and "0.3" a typo?

    The option opacity for hover means:

    If an element is hovered over, the other elements become transparent.

    Examples

    Thread Starter totorosk8

    (@totorosk8)

    Hi, no that was not a typo thanks ^^
    But i still don’t see a change of color when the mouseover.
    Maybe i’m not using this properly and opacity is not what i’m looking for.
    I want to change the color, the fill color.

    bonus question : is it possible to load a picture (on a lightbox) when we click on a prefecture on the map ? I want to keep the tooltip (not sure if it’s the right word sorry) on mouseover but not on click.

    Plugin Contributor hupe13

    (@hupe13)

    hover changes only the opacity of an area, not the colors. You should see, that the opacity / transparency is changing, if you hover the mouse over. The transparency is changing back, if the mouse is leaving the object. If it does not work, do you have an example url?

    You can style your popup as you like, also with a picture. But a lightbox – I think, this does not work.

    The tooltip can have an other content: [hover geojsontooltip="Tooltip {name}"], see example. This is a geojson file with markers, but it should work with areas also.

    Thread Starter totorosk8

    (@totorosk8)

    In fact i had a conflict, i declared the changes twice and it didn’t work. Thanks.
    Otherwise is it possible to change the click action to open something other than the popup?
    Can you tell me which file (and part) to edit ? (is it the hover.js file ?)

    Plugin Contributor hupe13

    (@hupe13)

    See Bozdoz’s documentation for geojson options. The default click action is to open a popup. There are to possibilities for popup options: popup_property and the content between [leaflet-geojson ...] and [/leaflet-geojson].

    Thread Starter totorosk8

    (@totorosk8)

    ok thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.