Problem/Motivation

Is there any use case or description available for this module?

After installation there were two new menu items

  • /admin/structure/map_bundle
  • /admin/structure/map_layer

And that was all i could find.

Proposed resolution

  • ✅ Create a documentation page, based on the README
  • 🔄 Add detailed configuration steps in the README
  • 🔄 Update the image on the project page

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DaMa created an issue. See original summary.

andeersg’s picture

Hi,

Is the description on the module page not enough? Or would you like more descriptions on the different pages?

DaMa’s picture

Hello andeersg,

would be nice to have an example of what one can achieve when using this module.

andeersg’s picture

Administer your Leaflet layers through the Drupal UI and combine layers from multiple modules into bundles.

Why?

By default you can choose between the maps provided by different modules. But you cannot combine
maps from different providers without creating a module yourself.

With this module you get a interface for combining layers from different modules into a bundle
you can use in your map.

It is also possible to add a layer directly through this module.

That is the description from the module page, do you think it's clear enough? Would it help if that is added to hook_help?

gerhard1176’s picture

This module looks promising, but I too miss some documentation. It would be nice to see a use case on how you create an overlay layer of Geofield points and put it into the Map bundle - without making use of Javascript. I have tried to set up a map bundle with a couple of overlays - the base layer shows up fine, the overlays are empty. I am also puzzled by the fact that the layer switcher shows radio-buttons instead of check-boxes for the overlay layers.

andeersg’s picture

gerhard1176: This module ony provides data to leaflet module, if you have issues with the actual map and/or content of a layer then it would be better to create an issue in leaflet.

If a layer is working when added through the hook, but not through this module, then create an issue here and I can take a look.

DaMa’s picture

@andeersg Does this module solve my question https://www.drupal.org/project/geolocation/issues/3165760 ?

What confuses me is that you write about different modules. Do we need different modules, or can this also be different sources, e.g. geolocation gmx data from two different nodes?

andeersg’s picture

@DaMa: This module adds functionality to the Drupal Leaflet module, with this module you can add multiple layers which will be available in your map without knowing how to create a module and define layers in code.

This module will not work with the Geolocation module.

What confuses me is that you write about different modules. Do we need different modules, or can this also be different sources, e.g. geolocation gmx data from two different nodes?

This module does not have any map functionality in it self, it has a dependency on Leaflet module. It provides an admin interface to manage and add extra layers through UI instead of code.

chucksimply’s picture

I have to say, i'm also slightly unclear on it's exact use. A tutorial or real-world use case example would be extremely helpful. Thanks for the work on this module though!

andeersg’s picture

ChuckSimply:
Do you feel this explanation is lacking something? What could be added to make it more clear?

By default you can choose between the maps provided by different modules. But you cannot combine maps from different providers without creating a module yourself.

With this module you get a interface for combining layers from different modules into a bundle
you can use in your map.

chucksimply’s picture

Maybe something like this...?

Combine multiple map layers for a single Leaflet map directly through the Drupal UI.

Why?

By default, Leaflet allows you to display one map layer at a time. Leaflet Layers allows you to combine multiple map layers (i.e OpenStreetMap and Google Satellite) into a single map bundle, so users can toggle between these map layers when viewing a single leaflet map.

How to use

  • Install the Leaflet module along with any other modules that include desired map layers (Leaflet More Maps, etc).
  • Once enabling these modules, go to admin/structure/map_bundle to create your own Map Bundle.
  • Select “Enable” next to the map layers you want to feature in this bundle. Save.
  • Now when creating a leaflet map (though the display field or views), select the new map bundle as your map layer.
  • Multiple map layers are now combined on your single map.
_kom__’s picture

... or you can add your own layer on "Map Layer" admin page. All you have to do is add URL template and some attribution. A lot of nice examples are given there: https://leaflet-extras.github.io/leaflet-providers/preview/. Just copy red-marked variables from Plain Javascript window to fields on "Map Layer" page and enjoy!

andeersg’s picture

Status: Active » Closed (outdated)
ressa’s picture

Status: Closed (outdated) » Active

I agree, the description is a bit too general. Everyone here probably knows how Geofield and Leaflet work together, but not quite how this module fits in ...

For example, it would be great if the README included a list of the minimal steps required to display two layers in a View with Leaflet. This would help new users understand the concept much better.

Orkut Murat Yılmaz made their first commit to this issue’s fork.

orkutmuratyilmaz’s picture

Hello all,

I've created a Merge Request for this issue and I hope that it works.

Best,
Orkut

orkutmuratyilmaz’s picture

Status: Active » Needs review

I'm also changing the issue's status as "Needs review".

orkutmuratyilmaz’s picture

Version: 1.0.x-dev » 1.1.x-dev

Sorry for too much notifications.

I realize that, I did my commit and MR to 1.1.x branch of the project. So I'm changing issue's version too.

orkutmuratyilmaz’s picture

Any comments for the patch?

ressa’s picture

Title: Usecase or description available? » Document how to use the module
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new76.3 KB
new575.61 KB

Your detailed instructions made it easy to get it working. Thanks @Orkut Murat Yılmaz!

I would suggest to maybe add this sentence, at the end on the project description. Now:

It is also possible to add a layer directly through this module.

... expand it to this?

It is also possible to add a layer directly through this module via a TileLayer or WMS URL, as well as showing multiple layers simultaneously, combining Base layers and Overlay layers.

Also, perhaps these two images could replace the current image, to better showcase the possibilities?

Form

Leaflet layers form

Map

Leaflet layers map

ressa’s picture

Status: Reviewed & tested by the community » Needs work
orkutmuratyilmaz’s picture

Status: Needs work » Needs review

@ressa, thanks for your beautiful review. I've added your lines to another commit and it is a part of the first MR now.

I wish that the maintainers of this nice module would add those images to project node too.

Now I'm changing issue's status as needs review again.

ressa’s picture

Issue summary: View changes

Perfect @Orkut Murat Yılmaz, thanks! I have updated the issue summary, adding more details in the README, and updating the images as separate tasks.

azin89’s picture

@ressa Hi, I am trying to repost my question again. So, I have installed all the necessary modules to run Leaflet Layers, and it seems that everything works well. I have made new Map bundles, and new a Content Type, however, the problem is that it seems for each new map, I need to make a new content type, and in the Display options connect it to the relevant Map bundle, which doesn't seem to be right.
Unfortunately, the example here, and elsewhere stop just before mentioning how we could in practice make a new node/view that shows a map bundle.
Thanks.

ressa’s picture

Issue summary: View changes

Great, I now see it!

Perhaps someone following this issue has the answer, so that the steps can be added in the README and in the doc page at https://www.drupal.org/docs/extending-drupal/contributed-modules/contrib...

orkutmuratyilmaz’s picture

@andeersg, any chance for reviewing this issue too?