OpenStreetMaps was added as a base layer option in farmOS: #2906648: Add openStreetMaps layer(s)

And there is now a configuration form that allows you to make that the default base layer: #2772955: Add configuration for default map base layer

Google is still the default base layer in a fresh farmOS install. This complicates the initial installation, however, because Google requires an API key to use its map layers (see #2768895: Document Google Maps API key requirements).

We also already provide a shortcut for adding the API key to farmOS: #2884947: Add a shortcut configuration form for Google Maps API key

It might be worth making OpenStreetMaps the default base layer in farmOS if a Google Maps API key is not entered.

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Issue summary: View changes
m.stenta’s picture

The question is: WHEN should OSM be made the default?

Should it simply be the default when farmOS is installed?

Or should we give an option to enter a Google Maps API key during farmOS installation, and if one isn't provided then make OSM the default?

m.stenta’s picture

Or should we give an option to enter a Google Maps API key during farmOS installation, and if one isn't provided then make OSM the default?

I like this approach, because it also offers the ability to enter the Google API key during installation, which is helpful.

  • m.stenta committed 95ed5b2 on 7.x-1.x
    Issue #2906652: Make OSM the default base layer if Google API key not...
m.stenta’s picture

Status: Active » Fixed

Done! There is now a field for entering the Google Maps API key during installation. If one is not provided, it will use OpenStreetMap as the default base layer.

I updated the doc page here as well: http://farmos.org/hosting/installing/

BruceDawson’s picture

Actually, can we make it default to OSM if there isn't a Google API key... Do the check all the time, not just at installation.

m.stenta’s picture

@BruceDawson: Sure - I'm open to ideas for taking this a step further. The main consideration is that it requires a cache clear when an API key is added, or when the default base layer is changed, so that the new settings can get picked up. I added a configuration form that allows you to specify which layer you'd like to use as the default (#2772955: Add configuration for default map base layer), and that form clears the cache when it's submitted. (Technically it could be done without a full cache clear - that's just the easiest way - it just needs to rebuild the Openlayers source and layer objects.) Ultimately the API key needs to be entered manually anyway, so that either happens during installation, or after installation in the same config form - at which point you can also decide if you want to make OSM the default base layer. So I think it's a pretty good balance of options.

Status: Fixed » Closed (fixed)

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