views:

346

answers:

4

I'm writing an iPhone app that needs to interact with the Google Maps API, therefore I must user Javascript (please correct me if I'm wrong) to access the results and the route created.

Since the Javascript support in native iPhones apps is quite poor and slow, my idea was to ask a remote web server to do the job for me. That server would be running Apache and Php. So my question is, it possible to run javascript on the server side? and if possible, how would you do that?

ThankS!

+1  A: 

You can use javascript on a server, for a list of examples see this wikipedia article

Jared
+3  A: 

Besides server-side Javascript, you could access Google Maps API from wrappers in other languages; for example, here is an open-source project that wraps the API for Python (it does so by generating and wrapping the needed Javascript) -- that may or may not help for your specific use case, of course (but similar issues apply to server-side JS).

Alex Martelli
Do you know if there's any wrapper in php?
Hectoret
I've heard of http://www.map-server.com/googlemaps/overview.html but I have no experience with it.
Alex Martelli
+1  A: 

Google Maps API v3 has support for iPhone web apps, and iPhone OS 3.0 has Google Maps support for native apps. Both are a bit bleeding-edge and not quite complete yet, as I write this.

Chris Lundie
+1  A: 

After doing some research I found Aptana Jaxer, a open source software that allows you to run Ajax, HTML, JavaScript and DOM modification server-side. It's available in: http://aptana.com/jaxer

In their website reads:

HTML, JavaScript, and CSS are all native to Jaxer, as are XMLHttpRequests, JSON, and DOM scripting. And as a server it offers access to databases, files, and networking, as well as logging, process management, scalability, security, integration APIs, and extensibility.

There's also a very nice screencast that will get you started in a minute: http://tv.aptana.com/videos/introduction-to-jaxer-10?ref=search&refId=jaxer

Hectoret