The Google Maps base layer is hard-coded into the farm_map
module, which means it is turned on even if you do not enter a Google API key and make Open Street Map your default base layer. Without an API key, Google causes an error message to be displayed in the map:
This page can't load Google Maps correctly.
Original description
Hi, in a new brand install, without selecting an Google Maps API (so system selects openstreetmaps, that is the right choice in my case), I get a Google warning in Dashboard map (and others).
I'm attaching an screenshot where you can see a map with a Google label in the bottom left corner, but I think it's using openstreetmaps info! And an anoying warning asking if this is my web ;-)
Comment | File | Size | Author |
---|---|---|---|
farmosmap_Captura_2019-07-06_12-39-27.png | 47.11 KB | calbasi |
Comments
Comment #2
m.stentaThanks for the bug report @calbasi!
This is happening because currently Google layers are being added to the map all the time - regardless of whether or not you add the API key.
The solution to this will be to split the Google (and OSM) layers out into separate modules that can be enabled/disabled on their own. This isn't terribly difficult to do in theory. It might be a little more complicated because of the way the "default layer" setting is set up, though.
A bit of history, for reference:
Originally, farmOS only used Google Maps layers. With the addition of OSM (#2906648: Add openStreetMaps layer(s)), we also added a configuration option in the `farm_map` module that lets you select whether Google or OSM should be the default (#2772955: Add configuration for default map base layer).
As a follow-up to that, we also added a step to the farmOS installation form that allowed you to enter a Google Maps API key, and if you didn't enter one then the default map would be set to OSM (see #2884947: Add a shortcut configuration form for Google Maps API key and #2906652: Make OSM the default base layer if Google API key not available).
So, in order to fix this bug, a few things need to happen:
farm_map_google
andfarm_map_osm
Comment #3
m.stentaI'm updating the title and description of this issue to be more descriptive of the cause.
Comment #4
m.stentaRegarding:
There's a good chance we'll be rethinking some of the farmOS installation/configuration stuff soon in #3066502: farmOS Setup Wizard.
Comment #5
m.stentaThis has been resolved by #3083352: Migrate to farmOS-map library. The Google layers are now provided by a separate farm_map_google module. If you are not using Google layers, this can be disabled.