Could you add "Map Control - Geocoder" to the Leaflet ?

When I edit a form, I can not check a place on the map.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zenimagine created an issue. See original summary.

Tomazetti’s picture

Component: Geolocation field » Leaflet API
Status: Active » Needs review

I'm not perfect, but it's working. I tried to keep the design pattern.

I used an external library to do the geocoding and could not use the google maps geocoder already available in the module. Should I make a custom google geocoder adapted to the leaflet?

Tomazetti’s picture

Tomazetti’s picture

Even though you have not yet approved my previous patch, I've added a adapted geocoder google.

ChristianAdamski’s picture

Status: Needs review » Needs work

Hey, this is wonderful, but it has some issues:
- Do not write es6. It needs transpiling to es to be used with Drupal and I do not want to to that yet
- The google geocoder should work. The TOC from Google technically do not allow to use it with OSM, but that is seomthing others can decide
- In return, Nominatim and Photon should be available for other usecases as well. Their TOC do not forbid that
- I recently added a very simple Nominatim Geocoder. They need to be merged. Yours is more sophisticated
- I reworked some parts of the geocoder handling. Code needs to be adapted to that.

ChristianAdamski’s picture

Status: Needs work » Needs review
FileSize
62.31 KB

- Clean up a lot of the geocoding stuff and unify it
- add Photon geocoder

  • ChristianAdamski authored b628811 on 8.x-2.x
    Issue #2936707 by Tomazetti, ChristianAdamski: Add "Map Control -...
ChristianAdamski’s picture

Status: Needs review » Fixed

Thanks @Tomazetti. I rewrote a lot of the code, but it's still based on yours.

Tomazetti’s picture

Glad to help. Great job with the module, it's great to have an active maintainer.

I'm testing the geocoders and I found some problems. Should I describe them here or create another issue?

And one question, the google geocoder gets the API address formatted and displayed in the suggestions, but the photon API does not provide the formatted address. Do you think it would be interesting to format the address to display in the suggestions?

ChristianAdamski’s picture

- new issues please
- if you want to add the magic to print a formatted address, you are very welcome to do so
- the photon geocoder also has a weighted location setting. You could add the settings for that, seems useful

I would add single issues for each.

Thanks a lot!

Status: Fixed » Closed (fixed)

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