Adding waypoints on mobile app which uses Google Maps API 3.0 - iphone

I am working on the app for Android and iOS platforms. My client requires that the app has to have "add directions" functionality.
Let's say I have a TO and FROM points set on my app, and I want to show the best route between these two points. If it's just these two points it's fine. There's plenty of resources on how to proceed. But if I want to add some extra directions, like GO THROUGH for example, the internet has no answers for me.
If you could point me to any apps (have to use Google Maps) for mobile platforms, where this functionality is working it would be great. Maybe you have some sort of documentation or some other materials on the subject.
Thanks, Mike (poland)

try to format the uri like:
from:50.74,14.00889+to:51.66444,17.85679+to:52.66444,17.85679
you can add as much +to terms as you want
edit:
if you ar using the Map api, you supposed to have a code like thisone to calculate a route:
StringBuilder urlString = new StringBuilder();
urlString.append("http://maps.google.com/maps?f=d&hl=de");
urlString.append("&saddr=");//from
urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 ));
urlString.append("&daddr=");//to
urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 ));
urlString.append("&ie=UTF8&0&om=0&output=kml");
you should be able to add some waypoints in the discribed format.
urlString.append("+to:")
urlString.append( Double.toString((double)waypoint.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)waypoint.getLongitudeE6()/1.0E6 ));

The google maps api v3 has a directions rederer. You can render a pollyline between two points and have the pollyline be dragable i.e. you can pick a pint along the route and reposition it as a
waypoint. see the api documentation.
alternativly you can capture click events on the map add push the location into an array of stopovers to pass on the the routing request.

Related

Creat an offline map like maps.me application

I already import open street map Library(link of GitHub) in my application and it works completely (I used osmdroid + osmbonuspack)true , but i need to have my country map for offline mode . I used of mobile atlas creator for creating my Country map but mobile atlas creator doesn't allow me creating huge map.
What i have to do ? I want to have maps like maps.me in my application
please help me , I am working at this more than 2 weeks .
Thank you
I used the osmdroid-forge-app sample app from https://github.com/osmdroid/osmdroid/ as a starting point and downloaded the offline map files for my country from http://download.mapsforge.org/maps/ .
That worked for me out of the box.
maps.me very likely uses vector maps instead of raster tiles.
Take a look at Mapsforge or Mapbox Android SDK / Mapbox GL for vector map solutions.
Make more than one map archive or hack up Mobac to remove the limit

How to get road coordinates between two markers google map api

I need to create path exactly according to road coordinates from google map api.I am partially successful with the help of this "http://maps.googleapis.com/maps/api/directions/json?&origin=%#,%#&destination=%#,%#&sensor=false" service.
But this service provide me the coordinates as show in this image .
When we zoom this path it looks like this image .
Actually, I want to get exactly road coordinates with every curve.
Firstly I did this task with the javascript file which was in one of the tutorial of google map (SBMapwithRoute)but don't know why that javascript file stop responding now.
If any body know how this task will perform than please help me.Thank you
I have posted one artical on my blog may be help full check it
http://www.jogendra.com/wayPath
May be hellfull for you
if you wants get waypoints from your google maps waypath. then use this
NSMutableArray *wayPointsArray = [self decodePolyLine:polyline.path.encodedPath];
here decodePolyline is function that you seen on my blog
polyline is object of GMSPolyline *_polyline;
Thnaks

Soundcloud API: how to play only a part of a track?

For an upcoming project I am investigating the possibility to play only a certain length (for example 20s) of a track, using the Soundcloud API.
Could anybody indicate me if that is possible, or should a different track with that limited length be created separately?
Many thanks !
Maarten (WebForDreams)
There are a few ways you can do this. Are you going to be using the JavaScript SDK or the player widget? For the player widget, you can just use seekTo().
If you're using the JavaScript SDK you can use the setPosition() method:
SC.initialize({
client_id: 'foo'
});
SC.whenStreamingReady(function() {
var sound = SC.stream(52933447);
sound.setPosition(2000); // position, measured in milliseconds
sound.play();
});
If you want to stop at a particular point, you could use onPosition().
Hope that helps!

Where can I find the HTML5 <a href="attr:"> reference?

So my question is mobile specific, because I need the "maps:" param's attributes for
Something like this:
It opens the Google Maps native apps on iPhone, but I want to send the address or coords of the place too.
Thx!
You'll want to use the ll (lat & long) parameter ... so something like:
map
You'll likely want a zoom as well ...
map
(Or something like that) more info on Apple's docs.
Take a look at the maps url api here : http://mapki.com/wiki/Google_Map_Parameters#Location
For example to open a pin at 51.5, -0.17 use this url :
http://maps.google.com/?ll=51.5,-0.17&q=Austrian%20Trade%20Commission,%20Princes%20Gate,%20London,%20United%20Kingdom

Map app in iphone 4.1

I ran map application(built in) in iphone 4.1.when i give, for example "shops in new york", it shows in map with annotations of all shops.i hope it handles xml file through google URL.anybody knows that url to implement in my aplication?Needs URL for csv response or xml response with multiple latitude and longitiude values, u have given direct URL.
'Shops in New York' seems to be a predefined query that Google Maps accepts.
You can issue within a standard browser using
http://maps.google.com/maps?q="shops in new york"
I'm not sure if this is the problem you are trying to solve, however - feel free to provide some more detail and we'll see if we can figure it out.
Gemma