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

Re(add) static map feature #7333

Open
Lineflyer opened this issue Feb 25, 2019 · 20 comments
Open

Re(add) static map feature #7333

Lineflyer opened this issue Feb 25, 2019 · 20 comments
Labels
Feature Request A request for a new feature/function

Comments

@Lineflyer
Copy link
Member

Google stopped offering static maps for free. This is the reason, why the feature stopped working in c:geo. Details can be found here: #7150

I already added an issue to remove this code: #7332

At the same time or afterwards we could implement an alternative if available.

Is there a similar service which could e.g. provide OSM maps?

@Lineflyer Lineflyer added the Feature Request A request for a new feature/function label Feb 25, 2019
@moving-bits
Copy link
Member

moving-bits commented Feb 25, 2019

What would happen if we switch to OSM only, so no longer supporting Google Maps at all? We could focus on NewMap provider and strip some legacy code.

Even more radical: What if we switched to offline map file only. Yes, each user would have to download some OSM map file, but this would be once only, and we could strip even more old code (for on the fly loading of map tiles) and reduce complexity.
The pros could download (more or less) any OSM map and theme they like and update whenever they like, and for the beginners we would support the download process during installation by opening one of the official map content providers and guiding the users through selecting the map file they need.

I don't know how much of our development effort goes into live map tile loading and managing, but at least focussing on NewMap OSM only should reduce our efforts significantly - thinking of

  • we have to upgrade to Google Maps API v3 (coming from v1)
  • we have to implement NewMap structure for Google Maps as well
    etc.

We could smoothen the transition by pre-warning our users: "Google Maps are deprecated, will be removed in June 2019" or such...

How do you think about this?

@bekuno
Copy link
Member

bekuno commented Feb 25, 2019

A better download support for OSM maps is an extra issue.
(I saw recently a nice implementation in GCDroid)

For Google maps v2 the pricing problem will be greather then current I suppose.
Then the limit is also for the google live map.

What about e.g. Bing maps or HERE? (I don't know prices for that)

If we want support a higher compileSdkVersion then maps v1 is no more useable.

@Lomanic
Copy link
Contributor

Lomanic commented Feb 25, 2019

Here are I think the most viable alternatives to Google Static Maps that I found:

@Lineflyer
Copy link
Member Author

My personal opinion and also derived from some user events and user contact is, that a majority of users like to see Google maps, because they know these and they are not into specialized maps or OSM. Those users just need something they are familiar with.

I know there is a challenge to away from GMaps v1, however as far as I understood Google maps in an app(!) will still be unlimited free for the time being. So I would not recommend to drop Google maps completely.

Regarding the mentioned alternative I need to take a look.
For sure we are non-profit, but sometimes the problem is, that we are not an organization. Depends on how flexible and open-minded those providers are.

@bekuno
Copy link
Member

bekuno commented Feb 25, 2019

Here are some more alternatives:
http://geoawesomeness.com/google-maps-api-alternatives-best-cheap-affordable/

Do we have some telemetry data e.g. from google maps about daily users and requests?

@Lomanic
Copy link
Contributor

Lomanic commented Feb 26, 2019

This is about static maps, not Google live maps, but please don't remove Google live maps. I don't even use OSM-based live views because they are slower to download and navigate and don't provide aerial views which is probably the most important to me while looking for caches.

For static maps, maybe it would be useful to implement aerial views from Here or Bing and road/topo views from an OSM provider to save API calls on these paid providers?

@okainov
Copy link
Contributor

okainov commented Mar 1, 2019

Sorry for stupid question, but is there any meaningful reason to have those "static" maps at all? It's all about saving some piece of map as a picture around GZ, right? Usually you either have online connection or have offline map, in neother case you need this "static" stuff...

@rsudev
Copy link
Contributor

rsudev commented Mar 1, 2019

These static maps are a feature that c:geo had early on, long before even the existence of offline maps within the app. I have used it very seldom in the beginning (like 2011/2012) especially the satellite image versions, but no longer for quite some years. But I am for sure not representative and how widespread the usage is i don't know (usually when we break something in that area, we are quickly notified, so there are some people using it).

@Lineflyer
Copy link
Member Author

My impression from contacts with users is, that only very very few are using the full potential (i.e. all different stored maps) of the statis map feature. However many users (including myself) are missing the preview map, which used to be shown at the bottom of the cache details page.
It is a nice possibility to see the surrounding of the cache area to e.g. see on first sight in which neighborhood/region the cache is located without the need to invoke any other navigation/map tools.

So maybe we can strip the feature down to just load one single map with marker on it to show it in the cache details.

This brings up the question again, if our free Google quota could be sufficient then....maybe. But still then we need to setup a bank account for our c:geo account, which is not as easy as it sounds.
So it still might be meaningful to get some OSM static map for this purpose instead.

@okainov
Copy link
Contributor

okainov commented Mar 3, 2019

Still sounds like really legacy and not really useful nowadays... I'd support #7332 instead =)

@jirkaer
Copy link

jirkaer commented Sep 16, 2019

Hi, maybe this can be interesting.
https://api.mapy.cz

Api for Czech mapy.cz.

@Lomanic
Copy link
Contributor

Lomanic commented Sep 16, 2019

I don't see anywhere in this API a way to generate static maps (images).

For OSM, would it be possible for cgeo to host a static map generator? https://wiki.openstreetmap.org/wiki/Static_map_images lists a few public instances but they seem unreliable or they need an API key. The few I tested don't seem to let users to add markers in the image, but jperelli/osm-static-maps does.

@Oskar1983
Copy link

Please do not waste your time on this. Offline maps do the work.

@Lineflyer
Copy link
Member Author

Yes, its kind of low prio, but for some (rather spontanous) use cases or to get a first impression of where a cache is located it would still be useful.

@Lineflyer
Copy link
Member Author

I recently stumbled upon ESRI ARCGIS , who seem to provide several map sources (street, sat) in some kind of free plan for "non-revenue generating apps". Not sure about the license details and the limits however. Also I did not see if they support maps with userdefined marker overlay (as we used to have it for the google static maps).

@Lomanic
Copy link
Contributor

Lomanic commented Sep 25, 2020

I don't think that cgeo uses this kind of page, but there's some simplified web page (for printing) for each cache https://www.geocaching.com/seek/cdpf.aspx?guid=${GUID}&lc=10 (found via tomasbedrich/pycaching#29 which also provides an interesting way to get a cache GUID from GC code) that provides static Google maps. Only road maps though, two sizes.

As an example for GC30: https://www.geocaching.com/seek/cdpf.aspx?guid=bebfafc7-bae2-4f26-b3e7-1f9216caae07&lc=10.

The link to these two images is accessible with the following JS, to be converted to jsoup with some string manipulation

var scriptTags = document.querySelectorAll("script")
for(var i=0; i<scriptTags.length; i++) {
	if(scriptTags[i].innerText.indexOf("maps.googleapis.com") >= 0) { // find the script with the maps.googleapis.com links
		var script = scriptTags[i].innerText
		var json = script.slice(script.slice(0, script.indexOf("maps.googleapis.com")).lastIndexOf("{") -1) // find the closest "{" left to the maps.googleapis.com link and remove what's left to this character from the string
		json = json.slice(0, json.indexOf("}") +1) // find the closest "}" right to the maps.googleapis.com link and remove what's right to this character from the string
		console.log(JSON.parse(json)["large"]) // extract the links by serializing the resulting string as JSON
	}
}

Of course there may be different ways to parse the JS (using a dedicated JS parser like rhino for example).

@SammysHP
Copy link
Member

SammysHP commented Sep 26, 2020

But this works only for geocaching.com and counts for their quota, so they have to pay for our use.

@Lomanic
Copy link
Contributor

Lomanic commented Sep 28, 2020

Good points, and indeed, cgeo wouldn't be a good citizen if it scraped that. The project doesn't want to alienate Groundspeak.

@fm-sys
Copy link
Member

fm-sys commented Aug 29, 2021

More then two years later, is anyone still interested in this?

@Lineflyer
Copy link
Member Author

Definitely interested....I suggest to keep this feature request here as a backlog. Maybe some time in future someone finds a suitable service and is interested in implementing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request A request for a new feature/function
Projects
None yet
Development

No branches or pull requests

10 participants