• hello Support team.
    I have a set of leaflet-markers with the iconClass=”bus” and a .kml set of markers for which I have used the same iconClass string name. when I try to group the leaflet-markers with the .kml markers using the option=”iconClass” values=”bus” it only seems to work with the leaflet-markers but not with the kml markers. is it possible to group them together?

    thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author hupe13

    (@hupe13)

    Try for kml className=bus.

    Plugin Author hupe13

    (@hupe13)

    You can basically group everything. If you want to group leaflet-marker and leaflet-kml with leaflet-optiongroup use for grouping the options from the leaflet-... command. You can group kml (like geojson) with leaflet-featuregroup too, but there I need an example to give a better answer. The groups must have the same name in all cases.

    In this example I group leaflet-marker, leaflet-extramarker and leaflet-geojson with 3 leaflet-optiongroup shortcodes by color.

    Thread Starter sio2

    (@sio2)

    really thank you for your response. these are the line I’m using:

    KML markers:
    [leaflet-kml className=bus iconClass=”parada_autobus” iconUrl=”/wp-content/uploads/icons/busstop-location-pin-30px.png” src=/wp-content/uploads/kml_locations/paradas_bus.kml]

    leaflet marker:
    [leaflet-marker visible className=bus iconUrl=”/wp-content/uploads/icons/busstop-location-pin-30px.png”
    iconsize=”30,30″
    iconAnchor=”15,30″
    popupAnchor=”0,-30″
    tooltipAnchor=”0,48″
    iconClass=”parada_autobus” visible lat=11.031684457675361 lng=-63.98213926544427]TEST BUS STOP[/leaflet-marker]

    trying to group KML markers and the leaflet marker together:
    [leaflet-optiongroup option=”className” values=bus groups=”Paradas de Autobús”]
    this option doesn’t

    [leaflet-optiongroup option=”iconClass” values=”parada” groups=”Paradas”]

    Making a parent group with Vialidad (roads) and Paradas (bus stops)
    [leaflet-parentgroup parent=Vialidad childs=”Paradas” visible]

    can only manage to group the test leaflet marker.

    Plugin Author hupe13

    (@hupe13)

    I’m sorry, my documentation for leaflet-optiongroup is not correct:

    leaflet-geojson (-gpx, -kml): iconUrl, alt, className, color ….

    • You can use className for grouping, it is not used by leaflet-geojson but passed through.

    Correct is:

    You can use className for grouping if you use the option circlemarker, it is not used by leaflet-geojson but passed through.

    This example with gpx files shows the use of className for grouping.

    So you should use the icon options.

    [leaflet-optiongroup option="iconUrl" values="busstop" groups="Paradas de Autobús"]
    • This reply was modified 6 months, 1 week ago by hupe13. Reason: del tag not works
    • This reply was modified 6 months, 1 week ago by hupe13.
    Thread Starter sio2

    (@sio2)

    I’m trying to group these two kml:
    [leaflet-kml iconClass=”mun_antolin_del_campo” src=/wp-content/uploads/municipios_kml/mun_antolin_del_campo.kml ]Antolín del Campo[/leaflet-kml]
    [leaflet-kml iconClass=”mun_arismendi” src=/wp-content/uploads/municipios_kml/mun_arismendi.kml ]Arismendi[/leaflet-kml]


    [leaflet-optiongroup disableClusteringAtZoom=10 option=”iconClass” values=”mun” groups=”Municipios”]
    [leaflet-parentgroup parent=”Entidades” childs=”Municipios”]

    but the kml polygons don’t disappear when I unckeck the “Municipios = Borough”.

    Plugin Author hupe13

    (@hupe13)

    Group kml with leaflet-option and iconUrl:

    [leaflet-kml iconUrl=.../mun_antolin_del_campo/...png src=/wp-content/uploads/municipios_kml/mun_antolin_del_campo.kml]Antolín del Campo[/leaflet-kml]
    [leaflet-kml iconUrl=.../mun_arismendi/...png src=/wp-content/uploads/municipios_kml/mun_arismendi.kml]Arismendi[/leaflet-kml]

    [leaflet-optiongroup option="iconUrl" values="mun_antolin_del_campo,mun_arismendi" groups="Antolín del Campo,Arismendi"]

    [leaflet-parentgroup parent="Entidades" childs="Antolín del Campo,Arismendi"]

    mun_antolin_del_campo and mun_arismendi are substrings from iconUrl.

    Or do I misunderstand how you want to group?

    Thread Starter sio2

    (@sio2)

    doesn’t matter if I use [leaflet-optiongroup] option=”alt” or option=”iconUrl” the outcome is the same, create and parent the groups but deactivating the checkboxes don’t make the boroughs kml polygon to disappear. I don’t want to use option=”iconUrl” because I don’t want to display a maker for the polygons.

    //placing boroughs polygons KMLs

    [leaflet-kml alt=”antolin” src=/wp-content/uploads/municipios_kml/mun_antolin_del_campo.kml color=#57007F7A]Municipio Antolín del Campo[/leaflet-kml]

    [leaflet-kml alt=”arismendi” src=/wp-content/uploads/municipios_kml/mun_arismendi.kml color=#57007F7A]Municipio Arismendi[/leaflet-kml]

    //grouping boroughs polygons KMLs

    [leaflet-optiongroup disableClusteringAtZoom=10 option=”alt” values=”antolin,arismendi” groups=”Municipio Antolín del Campo, Municipio Arismendi”][/leaflet-optiongroup]

    //parenting boroughs polygons KMLs

    [leaflet-parentgroup parent=”Municipios” childs=”Municipio Antolín del Campo, Municipio Arismendi”][/leaflet-parentgroup]


    Thread Starter sio2

    (@sio2)

    alright! I change the optiongroup option to “className” and now they are appearing an desappearing with the respective ticking of the checkbox.

    thank you!!

    Thread Starter sio2

    (@sio2)

    here again. as I told you earlier, when I started using className, everything started to work with the grouping of kml polygons. so started to place the polygons of the eleven boroughs. but strangely, two polygons are not working as supposed to, they appear on the map but can’t get deactivated with the groups’ chechbox.
    after hours of thinking about it, I noticed that those two boroughs have parts separated from the mainland so the kml have separate polygons coded inside of it. could this affect the functionality of the kml file? how could it be fixed?

    Plugin Author hupe13

    (@hupe13)

    I’m sorry, but I don’t understand what you want to group by. Maybe it’s better to group the features from the kml file according to their properties with leaflet-featuregroup? Do you have an URL to a test page?

    Thread Starter sio2

    (@sio2)

    I found that the the kml file that have more than one polygon, <MultiGeometry>, present problems when trying to manipulate them in leaflet extensions.

    what Im doing now is editing the .kml file itself, so I can separate the different polygons in different .kml files.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘is it possible to group markers and kml together?’ is closed to new replies.