• What am I missing to understand? I have two data sources in geojson, and I want to use different symbols for each of the elements. Currently, all elements appear on the map, but they are all the same color (the first geojson is red -as supposed- and all of the elements of the second geojson are blue – that′s the problem). I’ve read the entire documentation and can’t figure it out. I apologize, but I’m not a programmer.

    “And by the way, how can we place the symbols next to the name in the legend? Thank you! Great plugin!!”

    [leaflet-map lat=41.47492520278639 lng=352.11181640625006 zoom=9 height=”450″]
    [fullscreen]
    [leaflet-geojson circleMarker color=red radius=5 src=”https://192.168.10.13/wp-content/uploads/2024/01/pote.geojson”%5DNome:{NOME}[/leaflet-geojson]
    [leaflet-geojson circleMarker color=blue radius=5 src=”https://192.168.10.13/wp-content/uploads/2024/01/clies.geojson”%5DNome:{NOME}[/leaflet-geojson]
    [[leaflet-featuregroup property=CAE values=”pot” groups=”Pote” visible=0]
    [leaflet-featuregroup property=”Com” values=”Br,Ce,Ch,Jo,Ma,Pe,Re,Ri” groups=”Br,Ce,Ch,Jo,Ma,Pe,Re,Ri” visible=0]

    • This topic was modified 1 year, 1 month ago by guezt0.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author hupe13

    (@hupe13)

    If you see red and blue circle markers, this is correct according to your code:

    [leaflet-map lat=41.47492520278639 lng=352.11181640625006 zoom=9 height=450]
    [fullscreen]
    [leaflet-geojson circleMarker color=red radius=5 src="https://192.168.10.13/wp-content/uploads/2024/01/pote.geojson"]Nome: {NOME}[/leaflet-geojson]
    [leaflet-geojson circleMarker color=blue radius=5 src="https://192.168.10.13/wp-content/uploads/2024/01/clies.geojson"]Nome: {NOME}[/leaflet-geojson]
    [leaflet-featuregroup property=CAE values="pot" groups="Pote" visible=0]
    [leaflet-featuregroup property="Com" values="Br,Ce,Ch,Jo,Ma,Pe,Re,Ri" groups="Br,Ce,Ch,Jo,Ma,Pe,Re,Ri" visible=0]

    I cannot say whether it is grouped correctly, as I do not know the content of the geojson files. And the markers are hidden at the beginning.

    If you want different colors for the markers from second file try instead of the second leaflet-featuregroup:

    [geojsonmarker property=Com icondefault=blue values="Br,Ce,Ch,Jo,Ma,Pe,Re,Ri" groups="Br,Ce,Ch,Jo,Ma,Pe,Re,Ri" visible=0]

    See the first example.

    And by the way, how can we place the symbols next to the name in the legend?

    This is not possible.

    Thread Starter guezt0

    (@guezt0)

    Thank you,

    I’ve already tested, and it works for the second GeoJSON file, but it affects the behavior of the first one. I didn’t explain it well earlier, and it’s important to mention that when I tried various solutions from the documentation, the behavior of one affected the other. Now, the first GeoJSON always appears static.

    Thread Starter guezt0

    (@guezt0)

    To complete, when I delete part of the code related to one of the layers, the other starts working correctly. That is, the layers work well separately. They only malfunction and seem to influence each other when both are on the same map.

    Plugin Author hupe13

    (@hupe13)

    Can I get please 2 small parts of your geojson files for download?

    Thread Starter guezt0

    (@guezt0)

    Sure, i will put them in a link.

    Thank you

    Plugin Author hupe13

    (@hupe13)

    Where is the link?

    Plugin Author hupe13

    (@hupe13)

    And by the way, how can we place the symbols next to the name in the legend?

    This is not possible.

    Here are examples with icon in control.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Styling markers in 2 different geojson sources in the same map.’ is closed to new replies.