Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-17-2009, 04:00 AM   #23 (permalink)
n8r0n
Registered Member
 
Join Date: Jun 2009
Posts: 7
Default

Quote:
Originally Posted by lorax View Post
I am hoping to be able to implement the Core Location solution in my iPhone optimized web page so that paramedics can click on a link next to a hospital's name and get directions in Google Maps from their current location. How would I incorporate this as Javascript into the HTML; either inline or as part of an external javascript file?

Assistance on this would be greatly appreciated! The paramedics of Alameda County would be very thankful!!!!

-joshua the lorax

Test site link here
Joshua,

I don't know if you can directly get the current location from the phone in a dynamic web page. See discussion here:

iPhone app that access the Core Location framework over web - Stack Overflow

or

Accessing the iPhone Location from a Webpage [splitbrain.org]

That's one advantage of the SDK. It gives you access to stuff like that. But, if you can get the current location (using one of the two techniques linked to above, or some other way), then you can use a web page like this:

Code:
<html>
  <head>
    <meta name="viewport" content="width=320"/>
    <script language="javascript" type="text/javascript">
      <!--
      function mapTo(address) {
	// put something more sophisticated here, if you don't want to hard-code the start coordinates:
	window.open('http://maps.google.com/maps?saddr=47.58012312,-122.3459&daddr=' + address);
      } 
      -->
    </script>
  </head>
  <body>
     Click on <a href="http://maps.google.com/maps?saddr=47.57164,-122.4096&daddr=4916+Erskine+Way+SW,+Seattle,+WA,+98116"> this link</a> to open the Maps app.
     <br/>
     Or click on <a href="#" onClick="javascript:mapTo('5040+Erskine+Way+SW,+Seattle,+WA,+98116');return false" >a more dynamic map link here</a>.
  </body>
</html>
I put this page on my webserver, and tested it with my iPhone. Does this help?
n8r0n is offline   Reply With Quote
 

» Advertisements
» Online Users: 355
16 members and 339 guests
ADY, apatsufas, Dani77, Dattee, dcool, Desert Diva, HDshot, HemiMG, ilmman, leahov, mer10, michelle, nobre84, Raffaello, Robiwan
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,222
Posts: 380,724
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:30 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.