Serving the static map API with CORS headers

406 views
Skip to first unread message

louis-rémi Babé

unread,
Dec 6, 2011, 6:38:09 AM12/6/11
to google-map...@googlegroups.com
Hi there,

I'm experimenting with a mobile Web client for Google Maps and I'm trying to store static maps for offline use.
Unfortunately, unless CORS headers are sent along with the maps, they can't be serialized and saved to localStorage or indexedDB. (appCache isn't a solution, it's not dynamic, therefore maps cannot be created/updated/deleted at will by users).

Is it something conceivable?

Best regards,
Louis-Rémi

Rossko

unread,
Dec 6, 2011, 2:57:02 PM12/6/11
to Google Maps JavaScript API v3
> I'm experimenting with a mobile Web client for Google Maps and I'm trying
> to store static maps for offline use.

That would be against the terms of use
http://code.google.com/apis/maps/terms.html
10.1.3

louis-rémi Babé

unread,
Jan 27, 2012, 5:28:26 AM1/27/12
to google-map...@googlegroups.com
Hi Rossko,

According to the terms of use I may store "limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily, securely, and in a manner that does not permit use of the Content outside of the Service".

Is there any reason we couldn't do the same thing with the same limitations for the purpose of providing a seamless experience to users with an intermittent connection?
For example someone use my app to browse a map, then takes the plane. I would just like to let her pan around the last area viewed on the map, or zoom-in/out once or twice. This is exactly what Google Maps apps on Android allow; and this would just require to store a limited amount of content, as temporarily and securely as I would have done if I only wanted to improve the performance of my Map.

Do you think the terms of use could be amended to allow such use case?

Regards,
Lr

Andrew Leach

unread,
Jan 27, 2012, 5:47:09 AM1/27/12
to google-map...@googlegroups.com
2012/1/27 louis-rémi Babé <lrb...@gmail.com>:

>
> According to the terms of use I may store "limited amounts of Content for
> the purpose of improving the performance of your Maps API Implementation if
> you do so temporarily, securely, and in a manner that does not permit use of
> the Content outside of the Service".
>
> Is there any reason we couldn't do the same thing with the same limitations
> for the purpose of providing a seamless experience to users with an
> intermittent connection?

I think the issue is "a manner that does not permit use of the Content
outside of the Service."

That clause allows browsers to cache the data. I don't believe it's
intended to cater for any other use.

> Do you think the terms of use could be amended to allow such use case?

Doubt it. The Terms are basically unchanged -- certainly in that
respect -- since they were first issued. That must be five years at
least.

You could always raise an Issue, but you will have to be absolutely
clear about your use case, and you may also need to specify your
security mechanism which ensures that the Content cannot be used
outside the Service.
http://code.google.com/p/gmaps-api-issues/issues/list

louis-rémi Babé

unread,
Jan 27, 2012, 6:16:55 AM1/27/12
to google-map...@googlegroups.com, andrew....@gmail.com
Storing tiles or static maps in localStorage or IndexedDB is as secure as displaying them in the browser: they can be saved to disk (using chrome dev tools), but I'm not making it easier to use the content outside of the service.

If this is done temporarily, for a limited amount of content, would that go against terms of use?

Thank you in advance,
Lr

Andrew Leach

unread,
Jan 27, 2012, 7:06:42 AM1/27/12
to google-map...@googlegroups.com
2012/1/27 louis-rémi Babé <lrb...@gmail.com>:

I believe it would. It would make them available outside the Service.
In fact any off-line storage such as this makes the Content available
outside the Service -- that's the whole intention of what you are
proposing.

Rossko

unread,
Jan 27, 2012, 7:10:30 AM1/27/12
to Google Maps JavaScript API v3
> If this is done temporarily, for a limited amount of content, would that go
> against terms of use?

I reckon so. You do not want to store the online content to improve
performance; you want to store it so you can use it offline. Would
it work without the storage? No. Then its not a performance
improvement, its a different capability altogether..

louis-rémi Babé

unread,
Jan 27, 2012, 7:18:22 AM1/27/12
to google-map...@googlegroups.com
Alright, thank you for your replies.
This is sad, I'll have to work with another map provider.
Reply all
Reply to author
Forward
0 new messages