views:

216

answers:

1

I have done google map in UIWebView and it works perfectly with routing stuff and all. But now i want to load some other map into the WebView and get all the features that i get from google maps. How can i do it?

For eg: I want to load this one to the UIWebView. http://stage.discoveritalia.it/conbipel/ .This is an italian map. I want to use it in the same way as google maps works in an iphone app. Plz help me.

A: 

Since you are using normal web-based Google Maps in a UIWebView and not UIMapKit you approach this as any other Google Maps implementation using JavaScript.

The way this is done is by defining a custom map tile layer. See the Google Maps API documentation for custom tiles for more information.

Note that beside the actual programming, you need to have (and the rights to use) the actual map tiles as well.

stefpet
For google-maps, what i do is that I save this http://code.google.com/apis/maps/documentation/examples/map-simple.htmlMIMEType as an html file. Then NSString *htmlPath=[[NSBundle mainBundle] pathForResource:@"map" ofType:@"html"]; NSData *htmlData=[NSData dataWithContentsOfFile:htmlPath]; [map loadData:htmlData MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:[NSURL URLWithString:@"http://maps.google.com/"]];After that parsing with th javascript gives me the result.I think I should change the html file that I use. If you got any idea, plz help me.
wolverine