I have seen several issues come by in the past stating this exact same issue. However upon request no one was able to create the steps to reproduce. Today I took the time to create these steps:

Setup:
1. $ composer create-project drupal/recommended-project drupal_map_test
2. Install the project like you would normally
3. $ composer require drupal/geolocation:3.0.0-rc6
4. Navigate to /admin/modules URL and enable module "Geolocation"
5. Then enable "Geolocation - Google Maps API"
6. Navigate to /admin/structure/types/manage/page/fields
7. Add a field named "Map 1" (field_map_1), type "geolocation", save
8. Add another field named "Map 2" (field_map_2), type "geolocation", save
9. Navigate to /admin/structure/types/manage/page/form-display
10. Set both fields to "Geolocation Google Maps API - Geocoding and Map", save
11. Navigate to /admin/config/services/geolocation/google_maps
12. Set a Google Maps API key, save

The actual issue:
13. Navigate to /node/add/page
14. In the second map use the searchbar in the top-left corner to search for an existing address
The loader will start spinning, but a result will never come. The first map does work as expected.

I have also tested this with geolocation:1.11 and then everything works fine.
I have tested the described setup in several different websites (using rc1 to rc6) and none of them works.

I have tested the above on Windows 10, in the latest versions of Chrome and Firefox.

As your request in other tickets I have tried to setup by test setup in https://simplytest.me/, but it won't let me create a project for some reason.

Comments

vrijdenker created an issue. See original summary.

christianadamski’s picture

Status: Active » Needs review
StatusFileSize
new484 bytes
'drupalSettings' => [
          'geolocation' => [
            'geocoder' => [
              $this->getPluginId() => [
                'inputIds' => [
                  $element_name

This is the relevant code. Reading the documentation, several calls of this with different elements_names should be merged. But they are not, they are ignored.

Well, here's a patch to make the array index unique. Weired it's required, but no big problem.

  • ChristianAdamski authored 49997c9 on 8.x-3.x
    Issue #3122970 by ChristianAdamski: Geocoder search field not working in...
christianadamski’s picture

Status: Needs review » Fixed
paul dudink’s picture

Thanks for your superfast fix! I tested it and ideed it fixes the issue.

Our original issue occurred when using multiple paragraphs with a geolocation field, so I also tested that scenario. On top of the scenario I described in my original issue I added the following:
- $ composer require drupal/paragraphs
- Install the paragraphs module
- Add a paragraph with two fields, named "field_map_1" and "field_map_2" (same as on the node itself) and configure them the same as well
- Add a paragraphs reference field to the node and add the paragraph type.

Then I created a node, added several of these paragraphs and tested both the node geolocation fields as the paragraph geolocation fields.
Everything seems to work fine now!

christianadamski’s picture

Well, "flink" is german for "fast" so...

You're welcome :)

Status: Fixed » Closed (fixed)

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