Problem/Motivation

This is basically the same issue as #2817279 but for Leaflet.
After a successful geocode, Leaflet centers the map, but it doesn't show or place any visible marker for the result.

Steps to reproduce

- enable the module
- create a field of type "geolocation" for an entity and set "Geolocation Map" as widget, with the "Map Control -> Geocoder" option enabled.
- create a new instance of the entity filling the new field with a value
- edit the entity
- search for an address within the widget

Proposed resolution

- Add the marker placement alongside the map centering

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

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

elgandoz created an issue. See original summary.

elgandoz’s picture

Issue summary: View changes
elgandoz’s picture

Status: Active » Needs review

christianadamski made their first commit to this issue’s fork.

anjuelsaphilip2020’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new881.83 KB
new976.99 KB

Hi, I've verified and tested MR !123 and applied the patch successfully on Geolocation Field 4.x. The changes are working as expected.
Following steps I followed:

  1. Enabled the Geolocation and Geolocation - Leaflet modules.
  2. Created a content type named Location.
  3. Added a Geolocation field and configured it to use the Geolocation Map widget.
  4. Enabled Map Control - Geocoder and selected the Photon geocoder plugin.
  5. Created a Location node and opened it in edit mode.
  6. Searched for an address using the geocoder search field on the Leaflet map.
  7. Observed the map behavior after selecting a geocoded address result.

Testing Result: After applying the patch, a marker is correctly displayed on the Leaflet map at the geocoded search result location.
Attaching screenshots for reference.
Thanks

christianadamski’s picture

Status: Reviewed & tested by the community » Needs work

This needs to be optional. I understand the use case, but I'm fairly certain must users to not want to display a marker on search.

So the corresponding (PHP) Plugin needs to be added a form element and the config setting added. It's pretty easy.

hoxton made their first commit to this issue’s fork.

christianadamski’s picture

Status: Needs work » Fixed

This was a lot of work, but should work now.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.