English 中文(简体)
Google手机地图实施
原标题:Google map Implementation in Iphone

我已经在我的 iphone 应用程序中应用了 Google 绘图功能 。 它工作正常, 但是如果搜索位置错误, 字符串错误, 它会绘制一个位置, 仅在点击搜索按钮点击后, 才会重定向到当前位置 。 如果位置错误, 如何执行此位置, 然后直接转到当前位置 。 我的代码就像下面一样 。

NSString *urlString = [[NSString stringWithFormat:@"http://maps.google.com/maps?z=14&q=%@",message] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

NSURL *url = [NSURL URLWithString:urlString];

if ([[UIApplication sharedApplication] canOpenURL:url]) {
    [[UIApplication sharedApplication] openURL:url];        
}

please give me a solution as soon as possible Thanks in advance

问题回答

由于您在离开应用程序时失去控制, 您应该总是在 < / strong > 打开 URL 之前执行有效性检查 < 坚固 >, 将 < code> messesage 传给 CLGeocoder 或第三党 Geocoder 。

CLGeocoder类参考

基本上在您的应用程序中查询位置字符串, < 坚固> 那么 格式将相应查询您的 URL 。





相关问题
How to decide the current point reach on google map?

How to decide the current point reach on google map? I have a list of points (pickup points) of a route that I want to show in my google map with polyline. Now i have to get the current location of ...

Topographical or relief data in Map APIs

I was wondering if anyone knew of any map APIs that offer topographical or relief data? I ve had a quick look at Google and Bing APIs, but could find nothing there. Google allow you to view a map as ...

Using maps on Windows Mobile

I m experimenting with maps on different mobile platforms. Getting Google Maps to work on Android was easy, following this tutorial. Getting the same to work on Windows Mobile is a different matter. ...

Adding a custom icon to a google map

I need a hand adding a custom icon to some Google Maps javascript. Code below for your reference: function populateMap() { var map = new GMap2(document.getElementById("map")); map.setCenter(new ...

RSS to KML Overlay

I m want to display my blog as a Google Map overlay (each post contains geotags). How can I dynamically create a KML overlay from an RSS? Or better, how can I create a loop (PHP) that would display ...

开放街道地图管理员

我需要开放Street的标记管理员。 地图,如山角地图。

热门标签