Using Google Maps offline (Js Api) - javascript

I'm trying to make an NodeJs App in which, on web page I'm using Maps, For some reasons I've chosen Google Maps and I want to stick to it. My question is, Is there anyway where I can either store or cache map tiles offline and later on use it as needed [Note: Not looking for any hack or Illegal way for it, I already know there are many such ways].
I tried and saw many options like GEE (Google Earth Enterprise) portable but I guess they are shutting it down very soon i.e by 2017.
Basically what I'm trying here is to minimize the data usage on rendering map tiles, so alternatively, if there ain't a way to make google map work offline any suggestion or advice for minimizing data usage is appreciated.

The offline access via Maps JavaScript API is not available at the moment. There is a feature request in the public issue tracker:
https://issuetracker.google.com/issues/35827808
Please star this feature request to express your interest and receive further updates from Google.

1.Use Localstorage instead it might help but will be used in google chrome.
2.Check this url it might help How to cache Google map tiles for offline usage?

Related

Implementing Google Maps API Key into Java Project using Vaadin

I have taken over a an ongoing project that is written in Java (something that I have no prior experience with, but I can code Python and C++) using Eclipse (which I am also new to). The project uses Vaadin components, and Eclipse runs it with glassfish which pops up a page in the browser with the results.
I have been successful in navigating myself around the code and made a few modifications, however one of them is a tiny Google Map with markers and I have having trouble displaying it. The previous owner has already set up a Google Maps API for it. When I run the code in Eclipse, the result appears with a link that starts with "localhost:8080..." which does not display the Google Map ("Oops something went wrong. This page didn't load Google Maps correctly. See the Javascript console for technical details."). The API become accessible to the component when I switch "localhost" with the IP of the computer, and the map displays.
I am trying to replace the API key of the previous owner of the project with one that I have just acquired here at Google Developers Console. While I have also searched and found many examples that are very similar to this one, I cannot locate any javacript files within the project via Eclipse that I can apply the solution with.
With the ultimate goal for this is to host the exported .war file on a server, any help on how to locate the link between the code and the API key is much appreciated.
Thanks
I suggest you use this semi-official addon instead of trying to roll your own. It allows you to give the API key directly in the component constructor.
You should check out the Vaadin add-on directory for other needs as well, it has hundreds of useful addons for many purposes.

Display the Google Maps Javascript API usage statistics on a custom website

I'm currently using the Google Maps Javascript API for displaying multiple Google Maps on a website. Since the usage is limited for non-paying users, I am trying to keep the usage as low as possible, but I would love to have a way to monitor those usage stats in a semi-realtime way.
I know that you can lookup these usage statistics in the Google Development Center, for different timespans, but I was wondering if it's possible to query those usage statistics in some sort of way for displaying them on a custom webpage?
I've already tried to find some topics here on StackOverflow around this subject, but the only one I've found that comes near to my question is this one from 2013:
Is it possible to display the statistics from the Google Developer Console on a website?
In that topic the correct answer was that it wasn't possible at that moment.
Is this still not possible at this moment or does anybody know a way to get those usage statistics out of the Development Center?
Unfortunately you can not see the statics on a custom web page.
It's not possible to get the usage information out of the Developers Console, but you could wire up the Maps JavaScript API to report back to your own analytics services which is easier to embed.
As an example, using Google Analytics, every time your code runs new google.maps.Map(.. you could run ga('send', 'event', 'map', load'); reporting that a map was loaded. The numbers might vary slightly since some users block analytics but I would expect them to line up closely.

Calling Google Visualization API Server-Side

I'm working on a project that involves exporting some HTML reports on a website into PDF format. I'd like to use the excellent flying-saucer Java library to do this but my major stumbling block is that several of these reports use the Google Visualization API to generate charts with JavaScript. Flying-saucer doesn't currently support parsing/executing JS, so those charts don't show up in the generated PDF file.
I was hoping to work around this by seeing if there was some kind of web service I could call instead via server-side code that would return the chart image in Base64 as a variable that I could reference in my view instead of getting it via JS.
The old Google Image Charts API is exactly what I'm looking for, but it has unfortunately been deprecated and it looks like it's slated to be removed completely by next year, so it's not an option.
I'm hoping Google has a newer alternative. If not, is there some other method that's recommended? Thanks!
You can call the getImageURI method of the chart to generate an image/octet stream URI. You can send that data to your server, and you should be able to reconstruct the chart as a .png image file. I've never tried to do this server-side, so I'm not sure precisely how you would go about it, but this java tutorial might be of some assistance to you: http://www.programcreek.com/2009/02/java-convert-image-to-byte-array-convert-byte-array-to-image/
Years ago I wrote Eastwood Charts which implemented the Google Image Charts API as a servlet, backed by JFreeChart, so that you could generate charts without having to rely upon Google, or send your data to their servers. :-)
I don't maintain Eastwood Charts anymore (like Google, I can't be relied upon either) but it is open source and the code works so you might find it helpful. You could also modify it to meet your own requirements, which is something that wasn't possible with the Google service.

Google Maps JavaScript API v3

Please can someone point me in the right direction.
I have spent a few days watching videos and reading up on google maps and am more confused now than when I started.
I run a worpress site and want to add a google map to show venues. I have done this by copying the the html from a previous google map that I created. I decided to start afresh and try to style the map that it looks more attractive and also see if I could create a database with my site locations that I could update.
In the process I came across a pluging that asked me for my API key. I struggled to find my API key and then started reading that google maps has done away with its previous version and is now using something called Google Maps JavaScript API v3.
Please can someone guide me how to go about using this and what its all about. I've read up on Google Maps JavaScript API v3 but am still confused. ?
If someone has some useful videos, like idiots guide to getting started....
The basic documentation can be found at google's developers site. If you are struggling with the basic maps functionality and skinning, you may find it helpful to use a wrapper that simplifies a lot of the process, like this gmaps project on github.
If you have a more specific problem, maybe you could edit your post and list exactly what hurdles you are facing.
If you are using Wordpress, why not try a plugin directly? It would probably take care of all the specifics, and leave you with just having to deal with managing the site. This one has rather good ratings:
http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/
Regarding your API key, it's something Google gives you when you register your site in order to use Maps. Try re registering.
Check this out: http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/getting-creative-with-the-google-maps-api/. Kind of like a beginners guide...

Simple Cloud Save to Google Docs

I need a way to save data to a user's Google Docs so that it can be accessed from any computer.
I'm writing a game in javascript/Canvas that will be downloaded as a stored application from the chrome store. All I need to do is save a small text file containing high scores and settings to the user's account, however the authentication process is extremely confusing to me, and I haven't found any javascript sample code that does this.
What is the simplest way to access and modify a user's Google Docs with javascript?
Edit: Is there an easy to way to use Google forms/other API's to save data? Could I use PHP or python with javascript?
I've also asked this a while ago.
Google doesn't have released a JavaScript API for Google Docs yet. But since it is a RESTful API, you could implement it by your own.
You can find the protocol documentation here: http://code.google.com/intl/de/apis/documents/docs/3.0/developers_guide_protocol.html
I decided to not do it, because expenditure would be too big for what I wanted to do.

Categories

Resources