Maps Not Opening ..see code

2 posts, 0 answers
  1. Dan
    Dan avatar
    26 posts
    Member since:
    Jan 2013

    Posted 27 Aug 2014 Link to this post

    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");
    }
  2. Martin Yankov
    Admin
    Martin Yankov avatar
    177 posts

    Posted 01 Sep 2014 Link to this post

    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.

     
Back to Top