I am implementing Google navigation by opening the URL -
https://maps.google.co.in/maps?saddr=xxxxxxxxxxxxxxxxxx&daddr=xxxxxxxxxxxxx
where xxxx means source address and destination address.
It will show the options for different routes or show the default route.
I have to set a new route from option at first and after that instead of default route, i want to show the route i selected first in my app...
please help me ..
thanks in advance
Related
i m wondering if there is a better way to change route after the navigation started , i m doing this :
-Stop navigation
-Remove old route
-Calculate new route
-Start navigation
i want to be able to add a waypoint after navigation already started and it calcults automaticly the reroute.
Yes, new waypoints need a recalculation. And also insertion point is on you or your users, since this can be pretty anything from new startpoint, new endpoint or whatever you like...
I am a beginner trying to code a running app and have run into a problem. I am running a loop every few seconds and want to display a markers infowindow on google maps API if the time has passed the total time for those runs, my problem is when one infoWindow pops up, it must close the others because I only ever get the bestMarker window to show up since it comes after lastMarker.
Here is my code -
if (getCount() >= lastDone) {
lastMarker.setTitle("Done!");
lastMarker.showInfoWindow();
}
if (getCount() >= bestDone) {
bestMarker.showInfoWindow();
bestMarker.showInfoWindow();
}
If anyone has a solution to make both windows stay open at the same time it would be greatly appreciated!
Well, Google Maps official doc says you can not display two/more infoWindows at a time.
An info window allows you to display information to the user when they tap on a marker. Only one info window is displayed at a time. If a user clicks on another marker, the current info window will be hidden and the new info window will be displayed
My Solution will be - create your Markers (custom view) like infoWindow design.
Looking for some clue to build a location input bar just above keyboard and user can tap location icon to input a location, similar as what Fb/twitter has on their mobile apps when click new post/tweet.
Are there any existing library that support this? Should I create a customized keyboard with this bar?
Many thanks for any clues!
Assuming you are simply looking to create the bar above the keyboard, inputAccessoryView, a property of both UITextFields and UITextViews, is what you are looking for. This allows you to add a UIToolbar to the top of the keyboard similar to what both Twitter and Facebook do.
You can read further in the Apple documentation here.
A simple implementation of this is as follows -
UIToolbar *locationToolbar = [[UIToolbar alloc] init];
locationToolbar.frame = CGRectMake(320, 384, 320, 53);
// Add location button to UIToolbar as desired
self.textField.inputAccessoryView = locationToolbar;
If you are looking to create a map to select the location from, MKMapView would be a good place to start.
I am using HERE Maps to show a map letting users choose a location of interest. It works fine on desktop, but on mobile devices I am experiencing some problems.
On Android devices, if I create a map using
var map = new nokia.maps.map.Display(document.getElementById("map"), {
// Initial center and zoom level of the map
center: startCoordinate,
zoomLevel: 5,
components: [
new nokia.maps.map.component.Behavior(),
new nokia.maps.map.component.ZoomBar(),
new nokia.maps.map.component.ScaleBar()
]
}
);
the browser freezes after a few seconds. You can test this at karmap.com; try to scroll down to the very bottom to find the map. If I remove the code shown above the browser won't freeze anymore (but I won't get the map, of course).
Another problem occurs, when loading the page on iOS devices; in the form at the bottom you can find an input box named "Place of Birth". After typing 3 letters or more I start an ajax request to find suitable city names. This doesn't work if I use the following code (right under the code snippet to create the map):
map.removeComponent(map.getComponentById("zoom.MouseWheel"));
map.set("baseMapType", map.SATELLITE); // Activates satellite imagery on the display
If I comment that code out, the ajax calls work fine.
For me, that is some strange side effect! Does anyone have a clue what is going on?
Thanks for any help or advice!
I'm making an app on android, using webview to load google map (using this url for my webview: http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html).
but i can't put a marker on that webview, can't somebody tell me how?
http://maps.google.com/maps?saddr=37.423156,-122.084917
The above simply shows the directions screen with missing destination field. If you want the pin to show on a simple map screen do this instead:
http://www.google.com/maps?q=37.423156,-122.084917
Clearly lots of ways to skin a cat - but I am loving the Google Static Maps API.
It generates a standard image (of desired size) and you can add points/lines/polygons all from a URL.
Whilst I haven't checked the terms, it is clearly possible to cache/store the result.
Documentation: http://code.google.com/apis/maps/documentation/staticmaps/
Example: http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false
http://maps.google.com/maps?saddr=NJ
load URL like this pass address where you want to put the pin