Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google map not rendering, Silverstripe 4.6.1 #225

Closed
TimStannard opened this issue Oct 7, 2020 · 4 comments
Closed

Google map not rendering, Silverstripe 4.6.1 #225

TimStannard opened this issue Oct 7, 2020 · 4 comments

Comments

@TimStannard
Copy link

Hey guys, the google map doesn't render in the CMS and the front end (Silverstripe 4.6.1)
I'm running on a localhost (MAMP), Google chrome. My Google API keys are added to the yml file (tested and valid). They aren't restricted.
I have installed all the requirements:

        "dynamic/silverstripe-locator": "3.1.1",
        "muskie9/data-to-arraylist": "^2.0",
        "symbiote/silverstripe-gridfieldextensions": "^3",
        "dynamic/silverstripe-geocoder": "^1.2"

and I've added a few addresses. Any ideas here? Thanks heaps

@TimStannard
Copy link
Author

If his helps, I've worked out it's not returning a request:
The following line of code is running in the LocatorController.php (line 87)

       // prevent init of map if no query
        $request = Controller::curr()->getRequest();
        if (!$this->getTrigger($request)) {
            return;
        }

@muskie9
Copy link
Member

muskie9 commented Oct 7, 2020

Hi @TimStannard,

The getTrigger() method checks if a search has been run by looking for the get var action_doFilterLocations. This get var is set as a config value on LocatorController.

I believe the way it is implemented in in the 3.1 release line, if the get var is not detected in the url, it will not return results. I'd have to check the reasoning here with the team for the current implementation. I believe in most of our use cases we do not display results until the user does a search, which then adds the get var to the url as a part of the form submission.

One suggestion I have, if this is a new project you're working on, would be to use master as it has been refactored quite a bit and while not tagged, is close to release. There is currently a PR #220 that will allow showing results on page load per location page. I believe once that is merged it would allow the behavior you're looking for.

@TimStannard
Copy link
Author

Hey, that's lit. The master branch is now rendering the map. Thanks for the heads up :)

@muskie9
Copy link
Member

muskie9 commented Oct 8, 2020

Glad that did it @TimStannard. We're hoping to tag/release the new major version soon, but in the mean time let us know if there is anything else you notice that seems to be broken. I'll close this ticket for now based on it working and the above comment noting the PR.

@muskie9 muskie9 closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants