• Resolved teddyyun

    (@teddyyun)


    Hi,

    I have one question. How do I adjust the transparency of a polygon? And I want to remove the borderline of the polygon. Is there a way?

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

    (@hupe13)

    Do you mean leaflet-polygon? The options are the same as leaflet-line:

    And the following Shape Options. See https://leafletjs.com/reference.html#path for details. ‘stroke’, ‘color’, ‘weight’, ‘opacity’, ‘lineCap’, ‘lineJoin’, ‘dashArray’, ‘dashOffset’ ‘fill’, ‘fillColor’, ‘fillOpacity’, ‘fillRule’, ‘className’

    Try fillOpacity.

    • This reply was modified 1 year, 4 months ago by hupe13.
    Thread Starter teddyyun

    (@teddyyun)

    thank you I tried the option you linked. I want to control transparency in the geojson file. I applied fillOpacity=1 . But this option worked. What error am I getting?

    [leaflet-geojson fillOpacity=1 fillColor=”white” color=”white” weight=0 src=”https://www.geotv1.com/wp-content/uploads/2023/11/Northern Hemisphere-Glacier Change-MIS4- 2.geojson”]{time}-{mis}[/leaflet-geojson]
    [markerClusterGroup disableClusteringAtZoom=1 feat=”properties.time ” strings=”45 ka, 40 ka, 35 ka, 30 ka, 20 ka” groups=”45 ka, 40 ka, 35 ka, 30 ka, 20 ka”]

    https://www.geotv1.com/geokorea-map/10000%eb%85%84/

    Thread Starter teddyyun

    (@teddyyun)

    I think I have half of it figured out. The polygon is initially opaque but becomes translucent when you hover the mouse over it. Is there a way to make it opaque even when I hover the mouse over it?

    Plugin Contributor hupe13

    (@hupe13)

    leaflet-geojson has the same options:

    adjust the transparency of a polygon?

    You can adjust the transparency with fillOpacity as I wrote. The value is between 0 and 1, default is 0.2.

    I want to remove the borderline of the polygon

    Set stroke=false. For example:

    [leaflet-geojson src=/url/to/your/file.geojson fillOpacity=0.5 stroke=false]

    If you hover the polygon, opacity changes and if you hover out, it changes back.

    • This reply was modified 1 year, 4 months ago by hupe13.
    Thread Starter teddyyun

    (@teddyyun)

    Thank you for your kind reply. It works now.

    • This reply was modified 1 year, 4 months ago by teddyyun.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Opactiy control of polycon’ is closed to new replies.