I'm trying to make an external call to the google maps application on the iphone from my application and send it straight to "streetview" mode from two lat, lon coordinates. I've tried a variety of combinations, but each one just sends me to the safari browser on the iPhone and not to the maps application.
Here is one of those tries:
NSString * latlonString = [[NSString alloc] initWithFormat:#"http://maps.google.com/maps?f=q&source=s_q&hl=en&layer=c&cbll=%#,%#&cbp=12,261.11,,0,5", lat, long];
For the record, I've successfully been able to call the external maps application to get driving directions.
Has anyone been successful in calling street view mode from an external app?
I don't think you can. Check the Apple's documentation for all available options for map links.
Related
I have recently posted a question regarding getting the user location which I thought I had solved using geolocation.GeoLocationProvider. However, I am having strange behaviour on different devices. On an iphone 5s, I get the most accurate and smallest circle marking my position. On a galaxy S3 I get very large circles and takes long to connect. I then connected a Nexus to my mobile over bluetooth and shared 3G internet. Funnily enough, my position was not showing at all. In all 3 cases, I tried going into bing maps and google maps and they all have shown my position very accurately. Is there anything I am skipping for this discrepancy between my code and bing/google maps' code?
Thanks you all,
Justin
The Bing Maps site uses the same functionality. All this does is wrap the different web based geolocation API's for different browsers into one easy to use class. This method pulls the location from the browser built-in geolocation functionality (older browsers had several different ways of doing this). This will make use of a GPS device if it has access (small circle), fall back to WIFI or IP address (large circles). A couple of things worth checking, if this is being used in an app, have you enabled access to the geolocation sensors? If this is being used in as a web app through the browser, did you get a prompt to allow access to your location and did you press Allow? If the device isn't able to access the GPS and it's using share WIFI from another phone I could see how this might confuse things.
Another option is to use the HTML5 geolocation API: http://www.w3schools.com/HTML/html5_geolocation.asp
I want to use to UIWebView to display google maps mobile website for my app. However; I need the current user location to be passed into the webview so that it may show a route. What steps must I take in order to not only pass the current location to the google maps url but also pass what I want it to route(for example, Costco)?
Second, my app is going to be a paid app and I was wondering if it is even possible to use google maps due to this? The app does not only have gps but other sections as well that I created myself.
Thank you so much
I think you dont want to show google-maps in an UIWebView. You should use either the MapKit-Framework or any other maps-framework like for instance route-me.
In both framework it is possible to draw polylines (links: MapKit, route-me) (which represents a route) and any other stuff like pins and a bubble with a circle around it which indicates the current location (links: MapKit, route-me (should be somewhere in the sample-programs)).
I am totally confused with google maps and maps of iPhone...
i have read that iPhone uses google maps.....and also spent some time on it....
But it never display the items like location pictures, balloons etc.
EDIT
THIS is photo for of browser
and following is same place for iPhone maps
second one did not show the annotation added by people.....
(this is what i was asking for ballons or other pictures which people adds to location on oogle maps)
I want to display all those in my application....
what should i do...
if you suggests implement Google maps API, then please suggest a working link...or provide some sample code if possible.....if anybody has done it...then please mail me at yogeshkumau#gmail.com
waiting for answer......
Points of Interests(location, pictures and baloons) that you are talking about can be shown in your maps, if you acquire the license for Google maps premier api. In that case you'd have to use dynamic maps by using google's web services. However if you want to implement it using MapKit framework on iOS devices, you'd have to draw your custom POIs using core graphics.
Apple has a special agreement with Google to use their maps on their platform. The internet is packed with examples of usage of MKMapView along with annotations (pins, there're no baloons on iPhone).
hello guys i have a UITableCell which has some details like this "550 Ashbury St., San Francisco, CA, 94117".the details are coming from database.now i want that when i click on the cell a new view should be loaded with google map with this address. any idea how to achieve this???
Use iPhone OS 3.0 which includes the MapKit framework using Google Maps. You don't need to do the browser way anymore since with MapKit you can embed your own map in the application.
The way I have done this to create a simple webpage on my server that sets up google maps and contains a javascript function which takes a location as a string argument. This function is responsible for setting up google maps to show the address.
I then load the page inside a UIWebView and I construct javascript which executes my javascript function with the argument, something like:
NSString* js = [NSString stringWithFormat:#"setup('%#')", location];
Then I execute it using:
[googleMapView stringByEvaluatingJavascriptFromString:js];
You'll need to geocode the address, to turn it into GPS coordinates, i.e. latitude and longitude. Google is not the only web service to provide this, but you'll likely use some web service for this purpose.
Once you have your coordinates, you can feed them to the MapKit component in the iPhone 3.0 SDK, which you can read more about at Apple Developer Connection.
Did I understand correctly:
Opening google maps from my App demands closing that App in order to display google maps App?
e.g doing so:
NSString* urlString = #"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
will close my App?
So how can I display a driving track between two points using the map kit?
Thanks-
Nir.
MapKit does not give directions. I think this is because of the licence agreement between Google and their map data providers.
The easiest way to show directions is indeed to open the map URL. You understand correctly, this will close your app and open the Maps application. Closing your app to show Maps may be the right thing to do from your users' points of view.
If you must have directions on your map without leaving your application, you'll have to build it yourself. You could render the route as one or more annotations with custom views. Unfortunately, your app will have to find the route information on its own (or use a third party library).