I am new to farms, and currently I am mapping our orchards(fields) using google satellite as base layer - the problem is, every time that I log in, the map on the dashboard page displays my areas (polygons), but the base layer is not selected (blank) ?
Also, I would like to know if it is possible to override certain field captions with more suitable names eg. areas to be orchards etc.
Hi @gertcoetzee - welcome to the farmOS community!
the problem is, every time that I log in, the map on the dashboard page displays my areas (polygons), but the base layer is not selected (blank) ?
This is a known issue, but we haven’t been able to pin it down yet. It seems to be somewhat inconsistent, and some have reported that it resolves itself. I personally have never experienced it, but others have. Here is the open bug report: https://github.com/farmOS/farmOS-map/issues/65
Have you tried the Mapbox layer? Curious if that works any differently than the Google layer for you.
Also, I would like to know if it is possible to override certain field captions with more suitable names eg. areas to be orchards etc.
It isn’t possible to override the work “Areas” without some significant hacking - it’s used throughout farmOS in many places.
Worth noting: we are currently hard at work on farmOS 2.x (a major upgrade), and “Areas” are now becoming new “Asset types” like “Land”, “Structure”, “Water”, etc. There will be a “Plant” asset type (called “Planting” in 1.x), and there has been talk about making an Orchard module that provides an “Orchard” asset type. So that might be something to watch for!
That does seem to be the pattern with this “bug”… it doesn’t work at first, but then magically resolves itself. I wish I knew why! But at least it’s working now…
We’re not going to include that in farmOS core, because the complexity it adds isn’t worth it IMO, but it can live on as an “add on” module for folks who want it. It still has a lot of the same “known issues” that come from the approach taken to legally integrate Google Maps with OpenLayers (by the upstream ol3-google-maps project).
While that technically works, it is actually against the Google Terms of Service to use their layers outside of the Google Maps JavaScript library.
That’s why ol3-google-maps was made… and it basically works around that by hacking things together so the Google Maps JS is rendered underneath the OpenLayers map, and all click events are passed through from OpenLayers to the Google JS underneath. It’s a bit of a mess, but it’s the only way to support Google Map imagery in OpenLayers, unfortunately.
You can complain to Google if you want. I wish they were more open to allowing their imagery to be used in other libraries, even with a normal paid API key! I don’t get it, honestly.
Its good to know we can support Google Maps basemaps with a custom module. Yeah, the Google maps API is frustrating…I’ve been slapped with some expensive usage changes too.
Yes! Although it was over 5 years ago… we considered switching to Leaflet when we were upgrading from OpenLayers 2 to 3, but at that point it didn’t quite meet our needs: https://www.drupal.org/project/farm/issues/2496845
Since then both Leaflet and OL have come a long way! We are pretty committed to OpenLayers now that we have our own farmOS-map.js library built on it. OL has been working well for us. But it doesn’t stop anyone from creating modules that use Leaflet maps in farmOS either! Lots of flexibility in the module and decoupled JS application layers.
Looking at the link, it sounds like that Leaflet.GridLayer.GoogleMutant library is working around the Google licensing issue as well. That link is actually really useful because it includes a list of various approaches that have been taken and the costs/benefits of each. Good resource to refer to! Seems like none of them are perfect.
I wish Google would just update their terms to allow use of the raw XYZ layers with an API key. It would save all this headache…
That said… all of this is just a roundabout way of saying that we can’t officially support the XYZ layer approach, because it goes against the TOS. But that wouldn’t stop someone from making their own custom module…
But as a hosting service, Farmier can’t offer that module. I can’t afford to defend against Google’s Lawyers!