I'm developing an android app and I have a route path generated from Google Directions API like this example here
I want to check whether a location X falls on the route or not.
How i can possibly do this ?
NOTE: After searching on Stackoverflow i found this question and it's similar to what i want to do but it is in JavaScript and from the answers i found a method in Google maps JavaScript APIs here that do what i want but it's not available for the Android API Library ,How can i use it on Android ?
I found my answer here it an API for android from Google Maps utility API contain method containLocation()
com.google.maps.android.PolyUtil.containsLocation()
from Google Maps Android API utility library.
You can use isLocationOnPath() from android-maps-utils library.
Related
I'm making an app using Google Maps that makes use of BOTH the Ionic Native Google Maps API and the JavaScript version. Of course, the Native API is used on one page called home.ts, and the Javascript API on a sub page called details.ts which is reached by tapping on the infoWindow for a marker.
So far, this setup actually appears to work for me - but apparently I need to import "GoogleMaps" from #ionic-native/google-maps into both details.ts and home.ts for the map images to load on the main page - the markers and everything else will work fine.
Unfortunately, I need both APIs because Ionic Native does not yet support the use of the Google Places API. However, this seems to have led to at least one nasty issue so far -
On iOS, the app has a random chance of crashing/freezing when doing any sort of transition event, whether changing from page to another (the usual cause) or even just panning inside the map generated by details.ts. In XCode, when the crash occurs, the error I see in the console is something like this:
*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[2]
Of course, the number in objects[2] can be any number, as far as I can tell.
I haven't seen anything like this in the Android version of this app yet, but I have a hunch that it's there. I talked to someone who thinks that the app randomly attempts to use the wrong API, but I was hoping someone could provide a little more insight, and perhaps any other things that COULD go wrong with such a setup.
when you are working with ionic and google maps app most of cordova plugins have issues recommenced to follow google maps js docs or follow https://www.joshmorony.com/ionic-2-how-to-use-google-maps-geolocation-video-tutorial/
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?
Am currently asked to work on a project where I need to show the elevation of current place. By googling I came acrosee Google Maps JavaScript API V3 which have Elevation Service and have a sample code over here. But the code is in Javascript. So now am wondering how to move into java coding using this sample code. Have anyone worked with Google Maps JavaScript API V3 because am not sure how to integrate the javascript into an eclipse project.
EDIT 1:
Is it like I should change my IDE to PhoneGap..? I have heard that through PhoneGap you can code in HTML/Javascript and create project for Android and iOS.
I just checked with PhoneGap and couldn't find support for Elevation Service.
Any help would be appreciated.
Thanks in advance
You may directly use Google Elevation API in Java. Make a request, parse json and you are done.
I write this in api v2:
map.enableGoogleBar();
I want to using v3, but I can't find enableGoogleBar function,
Where is it?
Check out http://code.google.com/p/gmaps-api-v3-googlebar It approximates the search functionality of the GoogleBar in v2, but works in v3.
This project offers a couple of advantages over the previous suggestion:
It includes a custom wrapper for the LocalSearch API's RESTful side, allowing tighter integration with a v3 map than is possible with the regular AJAX APIs LocalSearch object
It also includes a custom SearchForm so that you don't have to load the Search API at all.
It should be noted, though, that it does NOT (yet?) support AdWords, like the original GoogleBar did.
The Google Bar does not currently exist in the Maps API v3. You can implement the functionality manually by performing a Local Search using the Google AJAX Search API's.
http://code.google.com/apis/ajaxsearch/local.html
Is it possible to add google maps on a site designed specifically for the iPhone? I have never integrated maps in my websites before, so this question really goes more because of my inexperience.
Using basic html and javascript at the moment.
The Google Maps API V3 is specifically designed to work efficiently on mobile devices. There are some great tutorials here and here.
Any link to a Google Maps URL will automatically open in the Maps application, which may be more useful than simply embedding a map view in the website itself.
For example, a link to http://maps.google.com/maps?q=cupertino will automatically open the Maps application and run a search for "cupertino".
I think, if you only need a google map with some simple function. The simplest way is use the MapKit.Framework, it's a part of iphone OS. You can find the document here.
If you need to load your own web site, you need to use UIWebView. you can find the document here(http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html).
I think these two ways can help you solve your problem.
And sorry about the link, because I'm not allowed to post more than one hyperlink.