Skip to content

Layer styles #47

Answered by giswqs
jllucero asked this question in Q&A
Jun 17, 2021 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

See the example below

import leafmap.foliumap as leafmap

Map = leafmap.Map(center=[0, 0], zoom=2)

url = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/countries.geojson"

def style(feature): 
    return {
    "stroke": True,
    "color": "#0000ff",
    "weight": 2,
    "opacity": 1,
    "fill": True,
    "fillColor": "#0000ff",
    "fillOpacity": 0.1,
}

Map.add_geojson(url, layer_name="Countries", style_function=style)
Map

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@jllucero
Comment options

@giswqs
Comment options

@jllucero
Comment options

Comment options

You must be logged in to vote
1 reply
@jllucero
Comment options

Answer selected by giswqs
Comment options

You must be logged in to vote
1 reply
@jllucero
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants