• I am using the shortcodes for a map with leafletjs [wordpress plugin], the map has a number of markers in each group, is it possible or how do I:

    How to code the markers into a group?
    (Example would be restaurants of various food types)
    Add option to allow users to select with group of markers to show?

    If not possible via shortcode, how would this be done via coding (as never done this).
    Thanks

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

    (@hupe13)

    If you mean this plugin, there is Extensions for Leaflet Map. This plugin can group markers.

    Thread Starter johnuk71

    (@johnuk71)

    So can this extension allow a user to show only the markers of a group? For instance, only show french restaurants group on the maps instead of, all the groups?

    Plugin Contributor hupe13

    (@hupe13)

    Yes.

    [leaflet-map fitbounds]
    [leaflet-marker title="french" lat=...  lng=...   ]...[/leaflet-marker] //many markers
    [leaflet-marker title="italian" lat=...  lng=...   ]...[/leaflet-marker] //many markers
    [markerClusterGroup feat="title" strings="french,italian" groups="French Restaurants, Italian Restaurants"]
    [zoomhomemap fit]

    or you can distinguish with icons:

    [leaflet-marker iconUrl="...french..." ... ] ... [/leaflet-marker]
    [leaflet-marker iconUrl="...italian..." ... ] ... [/leaflet-marker]
    //many markers
    [markerClusterGroup feat="iconUrl" strings="french,italian" groups="French Restaurants, Italian Restaurants"]
    [zoomhomemap fit]

    These options are available so far. I may have another idea when I see your example.

    Thread Starter johnuk71

    (@johnuk71)

    You may have a number of say french restaurants dotted around a map, can you select from a side box to show just these? And similarly, options to select italian resteraunts etc?
    If so, woudl the previous code work or would this be something different? (or is this somethign in development?)
    Many thanks for your help so far.

    Plugin Contributor hupe13

    (@hupe13)

    You can use the code like above, these examples are adapted from the help page.

    Thread Starter johnuk71

    (@johnuk71)

    Hi, the selection box is all working well. One query, markers are colour coded, for instance french restaurant have a blue marker, italian a green marker. When more than one group is selected all the markers are clustered together and without the individual group colour coding.
    Is it possible to cluster by group? Or when selecting a number of groups, to have a cluster for each group in that markers colour?
    Hope that makes sense.

    Plugin Contributor hupe13

    (@hupe13)

    Is it possible to cluster by group? Or when selecting a number of groups, to have a cluster for each group in that markers colour?

    I searched the Internet: It is possible in principle to have 2 markerClusterGroups and customize the marckerCluster style. But I have no idea and knowledge how to bring this together.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Leaflet Layers’ is closed to new replies.