I have been working in this project for a month and i have made it almost complete except the last functionality, which is real time navigation from current location to destination in ionic framework. I have google a lot, saw links of stack overflow but all I get is there is no way to get real time location legally provided by google in their API. So In Ionic framework, Currently I am getting current lat and long and destination lat and long using service API.
Is this possible we use the same direction service response, and plot some pinpoints in the route between the current location and destination, and after some fixed interval check user location.
Will it behave at least near to that functionality which i am trying to make ? Or will it be legal to use the response from the service API as a base point to achieve this feature?
Related
I am developing a website which uses Google Maps place API to get an area from the user and need to show nearest restaurants, hotels,etc. I also need to show the distance and route between those places from the user selected area.
Can anyone help me to give some suggestions, links, or a tutorial to do that?
Well, I coundn't provide you all codes, but i can help you to build code, Kindly follow the following guidance. It might be help you.
Basically you required two APIs for this solutions:
1) Google Directions API
2) Google Places API
3) Javascript - GEOLocation (auto detect user location, Works if website hosted with ssl cert - https )
Step 1:
Here first you need to detect user current location from browser (using HTML5 navigator.geolocation ):
http://www.w3schools.com/html/html5_geolocation.asp
Step 2:
Now you required to search nearby hotels,restaurants, etc using Google Places API. Please check following doc where you can see that places api required location coordinates as a input and will respond you accordingly,
Web Service API Doc OR JavaScript API Doc
Step 3:
Directions API will works on between two points, So here it's better to build dynamic route between two Points (user location and particular restaurant/hotel/etc location) using Direction API. You can build route using marker click event.
Google Direction API - Javascript Example
I hope that i have tried to explain better as i can, Kindly ignore formatting and spelling mistakes, Just focus on step i given, Ignore other stuff!!
I have been behind the 8-ball all quarter for my class some how I am supposed to be able to do this in 4 hours.
My Assignment
The purpose of this assignment is to utilize a map to display a route using overlays/polylines.
The goal of this assignment is to enhance the assignment from week 5 (web service to retrieve directions) to display the retrieved directions as a route on a map in addition to a list of steps.
You are required to write a single application that runs on a tablet configuration (Nexus 10 or some variation of a 10 inch screen tablet)
User Interface Requirements
The left side of the screen (ListView, left-pane) will contain the interface outlined in the week 5 assignment. A user can enter a source and destination and retrieve a list of directions based on that input. So, the interface is a couple textfields, a button, and a list.
The right side of the screen (right-pane, details view) will contain a Map that displays the directions as a segmented line (route). The map and route gets updated/displayed after the directions are retrieved (selection of the button). An initial map should be displayed with some default settings when the screen is first loaded.
Other Requirements
The Map should display the entire route (start and end point) at the appropriate zoom level (depending on the distance). The correct map type should also be used depending on the distance.
You are required to use a Marker to display the starting point and ending destination.
You are required to use the MapFragment class.
You are required to use API V2 from Google Maps and the Google Play Services API.
You are required to use the XMLPullParser class for parsing the XML.
This application will look very similar to the Google maps application that is used on the web (with a lot less detail, no zooming in out of the map, etc), concerning the route displayed, and left pane to enter source / destination and direction list.
Using Android Studio I have tried Creating an Application using the Map Activity, but it creates and application that will not compile and it looks like it wants me to use Google Keys. I can't hand in an assignment that requires Keys assigned to me.
I already have 4 hours into this and I can't even get started. I read that v3 of googles map API's doesn't need keys, but I can't find anything that tells me how to use them and Android Studio Doesn't seem to give you options as to what to download and use.
I really need help.
I am now starting new project and I wanted to know if I could use google maps to solve my problem and get list of countries in selected route.
I tried to search on internet about this but couln't find anything what I needed.
Edit: So I created function which loops through routes steps and by given latitude/longitude coordinates in each step I can get in which country is this step taken by using googles geocoder.geocode function. But now I face new problem while I am looping through steps I get this error: OVER_QUERY_LIMIT indicates the webpage has sent too many requests within the allowed time period.
I even tried to set timeout for 500ms before caling geocode function but no use.
If you do a route request, it will always have details about crossing international boundaries.
Just try doing a from/to request on maps.google.com and you will see in the directions, when it crosses a border.
That same information is available to us to take from the direction response.
I am developing GPS based Location reminder in j2me. I am little bit confuse to which maps i use??.....Google maps & Nokia maps. Which one allows me good working... The working of my app are as follows :-
-User will provide a string to app to search a place of his/her desire.
-Then according to given string app will show a place on map by pointing marker on map.
-User can save that place or he/she can select a near by place rather than searched place by clicking on map or any other way.
-app will save that searched place coordinates & remind when it reached to near that place.
-When app remind to user about already stored place... that place should show on map by pointing an marker along with the how far he is from his destination.
The real choice here lies in whether to use a RESTful API like the Google Static Maps (or Nokia's RESTful Maps) or to use a native Java ME mapping library plugin such as the Nokia Maps API for Java ME. The latter has several major advantages:
Static mapping services such as the Google Static Maps API or Nokia's
RESTful Map API do not cache or tile the images when requested,
therefore each request involves a round trip to the server. If the
map on a mobile application needs to be refreshed at any time, using
a caching library will result in a reduction in network traffic after
around three maps have been displayed. An explanation of this can be
found here
As the name implies, Google's Static Maps API can only retrieve over
http static images for a requested coordinate point, image size,
image type and zoom level. Newer libraries offer additional
functionality out of the box offering dynamic Map content and touch
support, where the user can move around his/her current position,
zoom in, zoom out, modify the view mode to satellite or translate an
address to a coordinate point and show that on the map, among others.
This abstraction of the underlying functionality is hidden from the
developer so much less coding is needed in order to achieve the same
result .
Terms and Conditions for Nokia Maps are easier to fulfil than
Google - No legal restrictions of using the API outside a web browser
application or need to provide a link to the native Google Maps App
(if there is one), or to Google Maps (if there isn't one).
Nokia currently offer higher free daily request limits. Nokia Maps
API for Java ME supports up to 50,000 render requests per day and per
unique IP address (as of January 2012), for Nokia Developer
registered users (free of charge) while the limit for Google's Static
Maps API is currently 1000 unique (different) image requests per
viewer per day.
A couple of years ago there wouldn't be a choice, only RESTful solutions existed, but these days I would say a static http solution should only be used if you want a simple single image
As an abstraction of the underlying services, there are already a full set of examples to cover most of your use cases:
-User will provide a string to app to search a place of his/her desire.
-Then according to given string app will show a place on map by pointing marker on map.
http://www.developer.nokia.com/Commu...PI_for_Java_ME
-User can save that place or he/she can select a near by place rather than searched place by clicking on map or any other way.
Maybe you need to use a draggable marker:
http://www.developer.nokia.com/Devel...ples/#standard
Or react to the touch and find a Geocoordinate:
http://www.developer.nokia.com/Commu...PI_for_Java_ME
-app will save that searched place coordinates & remind when it reached to near that place.
This is known as geofencing and is covered by the Location API:
- http://www.developer.nokia.com/Resou...ty-events.html
-When app remind to user about already stored place... that place should show on map by pointing an marker along with the how far he is
from his destination.
Showing a Map with a Marker
http://www.developer.nokia.com/Devel...ples/#standard
For distance calculations, I guess you'd be after the ROUTING example
http://www.developer.nokia.com/Devel...mples/#routing
http://www.developer.nokia.com/Commu...g_with_Java_ME
Now you could re-write and all these services from scratch using RESTful APIs (and then go about debugging your code) , but I'm sure you'll agree it would be much easier to use an existing, working and tested framework for the low level plumbing and then just write your code on top using the services.
It is possible to encapsulate RESTful service in Java ME. As an example, added below is a screenshot from an app encapsulating the suggestion service
It is just a lot easier when someone else has already done this work for you and placed it in a library.
I'm developing a app that makes use of the Gmaps Places library and actually, I have two questions:
1) Does anyone know how long it takes to an added place(by POST request) to show up on the map? I only need it on the app's map, so I don't care if Google doesn't approve it. I've already sent the add request and received OK as response.
2) It is possible to search for markers, placed by me, as if they were places(and using radius)? Not necessarily using the Places library. I ask this to see if is possible to come with a backup plan if the waiting mentioned above is long(clients, clients...). Then I would have the places 'offline from Gmaps', mapped inside a JSON file.
If I understand you correctly, you want to combine Google's Places API with a custom location set? Without more detail I can't really tell you what the code would look like, but you'd basically want to mash up the results you get from places with your own data and place markers based on that merge. If you're searching by radius or polygon you can do a 'within bounds' search on your dataset and return any results that are within the search zone to feed into your marker creator.