當我在我的應用程序中點擊「在Google地圖中打開」按鈕時,我希望我的應用程序導航到Google地圖應用程序並打開我指定的地址並將標記到它。使用url方案將標記添加到ios中的google地圖
這裏是我爲此代碼:
UIAlertAction* googleMaps = [UIAlertAction actionWithTitle:NSLocalizedString(@"google_maps", @"Google Maps") style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
NSString *customURL = @"comgooglemaps://?center=41.039400,28.994583&zoom=16&markers=size:mid%7Ccolor:0xff0000%7Clabel:1%7CVodafone+Arena+Stadyumu";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
}];
當我在按鈕上點擊,它正確地定位到特定的位置。但是,它並沒有給它一個標記。有沒有辦法做到這一點?
謝謝:)
是的,這工作。謝謝 :) –