This is a migrated thread and some comments may be shown as answers.

Maps Not Opening ..see code

1 Answer 44 Views
Apple iOS
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dan
Top achievements
Rank 1
Dan asked on 27 Aug 2014, 11:24 PM
We're having issues getting Maps to open for IOS devices ..anyone see anything in the code thats wrong ..Android is Fine..just IOS ..Cant get maps to load Iphone, Ipad


function openGoogleMaps(latitude, longitude) {
    /*window.plugins.webintent.startActivity({
action: window.plugins.webintent.ACTION_VIEW,
    url: 'geo:0,0?q=' + latitude + ","+ longitude
});*/
    
        console.log("Begin: openGoogleMaps");
    var devPlatform = device.platform;
    
    if (devPlatform === "Android") {
        console.log("In: openGoogleMaps (Android)");
        window.plugins.webintent.startActivity({
            action: window.plugins.webintent.ACTION_VIEW,
            url: 'geo:0,0?q=' + latitude + ","+ longitude
});
    }
    
    if (devPlatform === 'iPad' || devPlatform === 'iPhone' || devPlatform === 'iPod' || devPlatform === 'iOS') {
        console.log("In: openGoogleMaps (iOS)");
        var iosMapURL = '"maps:q=' + latitude + ","+ longitude + '" target="_blank"'
        console.log('iosMapURL: ' + iosMapURL );
        window.open(iosMapURL, "_system");
    }
    console.log("End: openGoogleMaps");
}

1 Answer, 1 is accepted

Sort by
0
Martin Yankov
Telerik team
answered on 01 Sep 2014, 02:45 PM
Hi Dan,

Your iOSMapUrl resolves to '"maps:q=25,25" target="_blank"' and this is not a valid url. You should just have "maps:q=25,25". You can also take a look at the iOS Map Links Documentation for more information regarding valid iOS map urls.

I hope this was helpful.

Regards,
Martin Yankov
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apple iOS
Asked by
Dan
Top achievements
Rank 1
Answers by
Martin Yankov
Telerik team
Share this question
or