as we all know that driving direction is not supported in mapkit.so i think i can show driving direction in webview.i am showing google maps in uiwebview,but it shows the whole site i just want to show only map part with some zoom so that it looks like original maps application of iphone.also i don't know if this breaks the apple's Human Interface Guidelines(HIG) Rules,tell me if it is
A:
Load a string like this as an NSString (maybe strip the newlines). You can change the latitude and longitude, zoom level etc with stringWithFormat
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(35.000, 139.000);
var myOptions = {
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%">
</body>
</html>
Then set your UIWebView
s html to that. It will give you a page with just a map on it, allow you to scroll with your finger or zoom in, pinch zoom, and place a marker.
Use this to load the HTML:
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
nevan
2009-10-21 08:11:29
i want to show driving direction can you tell me how to do that with your code.i have two lat/longs locations,also what parameter shoul i pass into baseURL in the method - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
Rahul Vyas
2009-10-21 08:35:33
also tell me if i use this will the app rejected by apple
Rahul Vyas
2009-10-21 08:36:13
please post a sample code for this
Rahul Vyas
2009-10-21 09:18:45
This should be enough to get you started, now you have to work out how to make a web page with driving directions. I can't help you with that. As to the app getting rejected by Apple, it's impossible to say. Any app you submit, you take a gamble whether it's going to be accepted or not.
nevan
2009-10-25 04:18:10