Some links inside, some outside

29 views
Skip to first unread message

Twitch

unread,
May 7, 2009, 5:52:00 PM5/7/09
to phonegap
Thanks to Ray and his tips of commenting out the code below in the
PhoneGapDelegate.m file...
/*
* We don't have a PhoneGap request, it could be file or something
else
*/
///if (range.location == NSNotFound) {
///[[UIApplication sharedApplication] openURL:url];
///}
}

...the RSS feed that I was trying to use from Dashcodes examples opens
the podcast in quicktime and then correctly goes back to the app
instead of hanging in the Safari browser.

However, with this code commented out, my map link doesn't open the
google map app. Any way to have both? Opening the google map app was
one of those pleasant accidents. I had uncommented the above code and
had the google map code in an iframe in the /map/index.html file.
When I clicked the button to navigate to that file, the google map app
opened with the correct location. Gotta love those moments, course I
haven't figured out how to have both. :-(

If it's possible, I would love the advice.

Thanks in advance,
Twitch

Ray

unread,
May 8, 2009, 1:59:01 AM5/8/09
to phonegap
Hi Twitch,

Sure you can, just be more specific about which cases should go to the
new window.

For example in the same ELSE block add a condition to match for the
host maps.google.com (I assume that is the correct host)


if ([urlHost isEqualToString:@"maps.google.com"]) {
[[UIApplication sharedApplication] openURL:url];
}


Cheers
Ray

Twitch

unread,
May 8, 2009, 9:59:34 AM5/8/09
to phonegap
You're my new best friend, Ray. I tried it and it worked like a
champ. Took my app to yet another level. I scared my wife when I
yelled out "Yes! It worked!, I love that guy!" Love in a brotherly
way of course. :-)

I'm pretty good with the html code, but getting into the code in the
files outside of the "www" folder is not my cup of tea. Really
appreciate the help.

Thanks again,
Twitch

booyaadino

unread,
May 12, 2009, 9:08:46 AM5/12/09
to phonegap
I have been trying for a week now to get the map app to open. Could
you please post an example, I would greatly appreciate it!

Thanks!
> > > googlemapapp.  Any way to have both?  Opening the googlemapapp was
> > > one of those pleasant accidents.  I had uncommented the above code and
> > > had the googlemapcode in an iframe in the /map/index.html file.

ade

unread,
May 12, 2009, 9:12:08 AM5/12/09
to phon...@googlegroups.com
booyaadino wrote:
I have been trying for a week now to get the map app to open.  Could
you please post an example, I would greatly appreciate it!

  
heres sample code i use in an html file which opens the map api on the phone and pins a marker - if that helps:

a href="http://maps.google.com/maps?f=q&hl=en&q=Albertos @38.985012,1.536568&ie=UTF8&t=k&z=18&iwloc=address"

--
ade
...........................................................................................
www.ibizaA-Z.com
www.iphoneibiza.com
www.podcast-ibiza.com
www.ishopibiza.com
www.ibiza-blog.com
www.ibizawinter.com
www.ibizaa-z.com/webcam
http://twitter.com/blogibiza
Ibiza NOW - The Islands Magazine

booyaadino

unread,
May 18, 2009, 9:38:16 AM5/18/09
to phonegap
Thanks for taking the time to reply. I appreciate it!

The link now opens the map, however the map appears to show in a
browser. I thought it would open the actual map program. Am I wrong
to assume this?

Thanks again!
> www.ibizaA-Z.comwww.iphoneibiza.comwww.podcast-ibiza.comwww.ishopibiza.comwww.ibiza-blog.comwww.ibizawinter.comwww.ibizaa-z.com/webcamhttp://twitter.com/blogibiza

ade

unread,
May 18, 2009, 9:42:04 AM5/18/09
to phon...@googlegroups.com
on my app it opens the native google maps app - are you testing it on an actual build on an iphone ?



booyaadino wrote:
Thanks for taking the time to reply.  I appreciate it!

The link now opens the map, however the map appears to show in a
browser.  I thought it would open the actual map program.  Am I wrong
to assume this?

Thanks again!

On May 12, 9:12 am, ade <adeib...@gmail.com> wrote:
  
booyaadino wrote:
    
I have been trying for a week now to get the map app to open.  Could
you please post an example, I would greatly appreciate it!
      
heres sample code i use in an html file which opens the map api on the
phone and pins a marker - if that helps:

a href="http://maps.google.com/maps?f=q&hl=en&q=Albertos
@38.985012,1.536568&ie=UTF8&t=k&z=18&iwloc=address"

    


--
ade

...........................................................................................
www.ibizaA-Z.com
www.iphoneibiza.com
www.podcast-ibiza.com
www.ishopibiza.com
www.ibiza-blog.com
www.ibizawinter.com
www.ibizaa-z.com/webcam

Twitch

unread,
May 18, 2009, 10:01:17 AM5/18/09
to phonegap
booyaadino,

Sorry I meant to reply sooner, but have been really busy. I have this
code in a map.html file.

<iframe width="320" height="320" frameborder="0" scrolling="no"
marginheight="0" marginwidth="0" src="http://maps.google.com/maps?
f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1+reliant+park,
+houston,
+tx&amp;sll=37.0625,-95.677068&amp;sspn=52.902929,71.71875&amp;ie=UTF8&amp;z=14&amp;iwloc=A&amp;ll=29.694241,-95.403557&amp;output=embed"></
iframe><br /><small><a href="http://maps.google.com/maps?
f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=1+reliant+park,
+houston,
+tx&amp;sll=37.0625,-95.677068&amp;sspn=52.902929,71.71875&amp;ie=UTF8&amp;z=14&amp;iwloc=A&amp;ll=29.694241,-95.403557"
style="color:#0000FF;text-align:left">View Larger Map</a></small></p>
</iframe>

When I call the map.html in an iframe, it automatically opens up the
GoogleMap app on my iPhone.

-Twitch
> www.ibizaA-Z.comwww.iphoneibiza.comwww.podcast-ibiza.comwww.ishopibiza.comwww.ibiza-blog.comwww.ibizawinter.comwww.ibizaa-z.com/webcamhttp://twitter.com/blogibiza
Reply all
Reply to author
Forward
0 new messages