Title: Leaflet Layers
Last modified: January 20, 2022

---

# Leaflet Layers

 *  [johnuk71](https://wordpress.org/support/users/johnuk71/)
 * (@johnuk71)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/)
 * 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](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15273558)
 * If you mean this plugin, there is [Extensions for Leaflet Map](https://wordpress.org/plugins/extensions-leaflet-map/).
   This plugin can [group markers](https://leafext.de/en/cluster/groupmarkers/).
 *  Thread Starter [johnuk71](https://wordpress.org/support/users/johnuk71/)
 * (@johnuk71)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15273613)
 * 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](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15273916)
 * 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](https://wordpress.org/support/users/johnuk71/)
 * (@johnuk71)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15274070)
 * 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](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15274240)
 * You can use the code like above, these examples are adapted from the help page.
 *  Thread Starter [johnuk71](https://wordpress.org/support/users/johnuk71/)
 * (@johnuk71)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15277338)
 * 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](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15277856)
 * > 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.

 * ![](https://ps.w.org/leaflet-map/assets/icon-256x256.png?rev=1693083)
 * [Leaflet Map](https://wordpress.org/plugins/leaflet-map/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leaflet-map/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leaflet-map/)
 * [Active Topics](https://wordpress.org/support/plugin/leaflet-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leaflet-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leaflet-map/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [hupe13](https://wordpress.org/support/users/hupe13/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/leaflet-layers/#post-15277856)
 * Status: not resolved