89

Product support

Get help in the plugin support forum.

Categories

OpenStreetMap is a collaborative project to create a free editable map of the world while Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. Quickly enhance the contact and location pages on your site with an informative and colourful map.

Installation

You can install the plugin using any of the following methods:

  1. Install using OctoberCMS marketplace
  2. Install using composer: composer require initbiz/oc-leafletpro-plugin
  3. Clone the GitHub repo to plugins/initbiz/leafletpro directory of your project and run composer install in your project's directory

The plugin will automatically install maxhelias/php-nominatim, which is used to query Nominatim service. If you are going to use the Nominatim service, recall the Nominatim usage policy.

Embed the map

You can embed a map using the Leaflet map component.

Leaflet map component

As you see in the above screenshot you can specify a few parameters:

  • Longitude and latitude of the center of the map that is shown
  • Initial zoom of the map
  • Scroll protection to start zooming with scroll only after clicking the map
  • Leaflet plugins - checkboxes for enabling Leaflet plugins for the component

Customize popup content

Custom marker popup with InIT.biz logo

The popup content is defined individually for every marker. By default, it's seeded with the content of plugins/initbiz/leafletpro/models/marker/_default_popup_content.htm.

The partial can be easily overridden by creating the _default_popup_content.htm file in your theme in the partials directory. Remember that overriding the partial will not change current marker popups. This partial is used only as a seeder when popup content is empty while saving marker.

Cumulus integration

The plugin is nicely integrated with the Initbiz.CumulusCore plugin.

  1. When the cluster is created or updated (address changed), a marker is created or updated
  2. When the cluster is selected in create marker view address is refreshed from cluster's address

TODO / Future plans

  • Marker categories to filter markers on maps
  • Single marker map
  • Backend form widget for current lon / lat preview and for setting lon / lat using the map marker
  • Easily configurable marker icons for markers and categories from the backend
  • Add possibility to manage more than one marker by Cumulus clusters
  • Pop up in backend with other possibilities for the same address (right now getting only the first element)
  • Support Leaflet plugins
1.7.0

Add reset button

Feb 13, 2024

1.6.0

Add compatibility for october 3

Aug 14, 2023

1.5.0

Add pick localization component

Sep 30, 2022

1.4.2

Add image to groups table

Apr 21, 2022

1.4.1

Add compatibility for october 1

Apr 20, 2022

1.4.0

Added group markers and cleanup code

Apr 19, 2022

1.3.2

Fix marker property

Sep 16, 2020

1.3.1

Fix Lon, Lat and remove validation

Jul 22, 2020

1.3.0

Minor cleanup, backwards compatibility fix and icon from mediafinder

May 13, 2020

1.2.0

Add new plugin Color Filter

Apr 28, 2020

1.1.1

Fix issue in checkbox properties

Nov 08, 2019

1.1.0

Added single map component and a few major changes

Jun 04, 2019

1.0.3

Custom default marker icon URL in settings and overriding initial lon, lat and zoom using GET params

May 16, 2019

1.0.2

Added markers table

Mar 08, 2019

1.0.1

Initial version of LeafletPro

Mar 08, 2019