I have a custom made tile for google map. Works perfectly fine online, but when I turn off data on my phone, it just shows the loading icon, as it can't communicate with google.
As I have my own tiles, is it possible to use google maps offline with phonegap?
I don't believe it is possible to use Google's API offline. However, If you have your own tiles, and have them embedded within your application archive, you could use Leaflet to render the local tiles. http://leafletjs.com/ If your custom tiles are remote (hosted on a server), then you're still not going to be able to consume them in an offline scenario.
Related
I've used the Google Maps JavaScript API to put a bunch of markers on a map, within a web page. I'd like to allow users to choose to open the map, with markers, within the Google Maps app, should they have it on their device.
Currently the markers, when clicked, display the name of the location and some other details. I'd like to maintain this functionality within the app too.
Is there an easy way to achieve this? I'm a front-end web developer with a decent amount of JS experience, but I don't have any experience developing iOS or Android apps, and I was hoping there'd be an easy solution within the API, but haven't come across an answer. There's a good chance that this simply isn't possible due to the differences between the web and app platforms, but I just don't know.
This is a built-in feature of the Google Maps iOS (and thus I assume Android) API. In the iOS API, add the following entry in Info.plist file:
LSApplicationQueriesSchemes
Item 0... String... googlechromes
Item 1... String... comgooglemaps
And then whenever a marker is tapped in the app, if the user then taps the Google attribution logo (usually at the bottom of the screen), the Google Maps app will open that marker. These entries allow for that to happen.
The Android guys can speak to Android but I'm sure it's as simple, if not simpler. Here are some methods: How to open standard Google Map application from my application?
We have tried using the Google Places API on iOS and Google Places Web Service to get a verified SAB (service area business), that is a business that has an address but that does not have a physical location, rather it serves a certain area.
Here is an example business "Japanese Mobile Hairdresser Scissor Paper Rock" that you can try.
After trying nearby, textsearch, autocomplete and other APIs we came to the conclusion that because there is no physical address and the business actually just serves an area it makes sense that the Google Places API does not return this business or any other SAB.
Using Google Maps directly though does return the business and so does the sample that Google has on this page about the js API
https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder
Also searching around on the internet you will find articles like this
https://productforums.google.com/forum/#!topic/map-maker/0-0wplytssg
that seem to suggest that although SABs will not show on a map they will return in the search results of a map as the above sample suggest and also using Google Maps directly.
Logically then we tried to create a web page that uses the js API example to see if we can search for the "Japanese Mobile Hairdresser Scissor Paper Rock" business only to find out that although it gets returned by Google's sample when we add our API key and host that file on a server neither this business nor any other SAB gets returned.
Has anyone else experienced this problem? Is there any way to get SABs by using any of the available APIs from Google, whether it is Google Maps or Google Places or any other? Do you know if Google returns different results on their maps rather than the APIs?
FYI all these APIs are enabled on the Google Console API
Google Places API for iOS
Google Places API Web Service
Google Maps SDK for iOS
Google Maps JavaScript API
Google Maps Geocoding API
Any help would be greatly appreciated.
I am building a web app with Google AppEngine. I am using the Google Maps, Google Places, and Geocoding API's.
In the local version, everything works as it should. When the page is loaded, the user's current location is indicated and all the nearby stores are marked with markers on the map that appears on the webpage.
In the deployed version, only the map loads. I checked the console developer's log on Google and I noticed that a request to the Google Maps API is made, but not to the Google Places or Geocoding API's. I'm really confused/not sure what's going on. I tried browsing through some old questions, but I can't figure out how to fix this. If anyone could offer a solution, I would greatly appreciate it.
** I have made sure that the deployed version is the most recent version. It 100% works on localhost, but doesn't on the deployed webpage.
Edit: the API's aren't being called because they don't work on "insecure origins". I've configured the app.yaml under handlers to be
- url: /.*
script: IGNORED
secure: always
but it doesn't seem to make a difference.
You don't have to separately call Google Places and Geocoding APIs. All those are included in the Google Map API. If you want to choose on what you should include in your map click here to refer the API on customizing your map.
By default, Google App Engine doesn't support secure connections, which both the Geolocation & Google Places API's need, in order to be called. However, Google App Engine can support secure connections. The local host does support secure connections, which is why the local version of my app was working.
To properly support secure connections after deploying the app, just add in the parameter "secure: always" in the app.yaml file under Handlers!
In a hybrid web application (PhoneGap) I have been working on I have implemented the Google Maps JavaScript API v3.
The map is a large part of the application and it is important that I do everything I can to make sure performance is the best quality I can get it to for the application.
One the most noticeable problems with the map is the following:
Open app and load map
Close application and reopen application
Load map again
When the map is loaded again it takes the same amount of time to load as it did the first time which can be a few seconds. This seems completely unnecessary to me and bad design on my part. If these tiles have been downloaded a matter of seconds ago surely the images should be cached for a faster load the second time round?
This may well be part of PhoneGap itself as I'm sure that Google does make an effort to return cached images.
How can I improve these map load times in my PhoneGap application?
Please consider this plugin.
https://github.com/wf9a5m75/phonegap-googlemaps-plugin/
This plugin uses Google Maps Android API v2 and Google Maps iOS SDK.
Those makes cache internally, and loading map tiles is faster than Google Maps API v3.
I have integrated Google Maps in my application using their Javascript API.
I have a requirement to popup an Information Dialogue and show a static map image when there is no internet connection available, but google Map is already launched on the browser.
Does google javascript Map API provides a handle/response when i zoom or pan while it is fetching the image tiles and no internet connection available ?
No,It's not possible to handle google maps javascript api without internet connection you must have active internet connection.