Yahoo! Developer Network Blog

« Previous | Main | Next »


July 10, 2008

Yahoo Maps on the iPhone

iPhone is creating a craze in Romania, as it's done all over the world. Since Yahoo is very popular in Romania and, moreover, Yahoo! Maps is considered the API to choose for the detailed view of Bucharest, Mobi One and MB Dragan thought of creating the Yahoo! Maps application for iPhone and iPod Touch.

Here is what they have to say about it:

We've created Mobi One Maps because Google Maps (the application available for iPhone) did not have a detailed, street-level map of Bucharest. To do this we used Yahoo! Maps and Mootools.

One of the issues we encountered was trying to modify the navigation buttons, since the existent documentation did not mention anything about this situation. So as a solution we used map.panTOXY() as follows:


window.addEvent('domready', function() {
  var container = map.getContainerSize();
  var delta = Math.max(container.width,container.height) / 2;
  var move_up = new YCoordPoint(container.width / 2, container.height / 2 + delta);
  var move_down = new YCoordPoint(container.width / 2, container.height / 2 - delta)
  var move_left = new YCoordPoint(container.width / 2 + delta, container.height / 2);
  var move_right  = new YCoordPoint(container.width / 2 - delta, container.height / 2);
  $('move_up').addEvent('click', function(event) {
    event = new Event(event).stop();
    map.panToXY(move_up);
  });
  $('move_down').addEvent('click', function(event) {
    event = new Event(event).stop();
    map.panToXY(move_down);
  });
  $('move_left').addEvent('click', function(event) {
    event = new Event(event).stop();
    map.panToXY(move_left);
  });
  $('move_right').addEvent('click', function(event) {
    event = new Event(event).stop();
    map.panToXY(move_right);
  });
});

In a previous version we've tried to navigate using the iPhone events (tap, drag and pinch), but through GPRS the map was moving very slow so we had to rule out this solution.

For all the visual effects we've used MootoolsFX.

The application had been accepted by the apple.com editors and posted as "featured web app" in the Travel category for 5 days, now being one of the most popular application from this category.

Bobby Voicu (Yahoo! Romania) and Mihai Dragan (MB Dragan)

Posted at July 10, 2008 6:00 AM | Permalink

Bookmark this on Delicious

Comments

Great application!!! I have just actually tried out to implement the map pinch and drag events via a custom UIWebView BUT facing a huge issue: when zooming out/in and moving, after a while, the tiles do not get refreshed and just see a blank map with the markers...
Have you noticed something of this nature?

Posted by: Olivier at September 18, 2008 11:31 PM

Post a comment

Comment Policy: We encourage comments and look forward to hearing from you. Please note that Yahoo! may, in our sole discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service. Fields marked with asterisk '*' are required.

Remember Me?

Subscribe

YDN Blog: Get Yahoo! Developer Network Blog on your personalized My Yahoo! home page.

Add To My RSS Feed

YDN Link Blog: Get Yahoo! Developer Network Linkblog on your personalized My Yahoo! home page.

Add To My RSS Feed

Recent Readers

Copyright © 2010 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy

Help us continue to improve the Yahoo! Developer Network: Send Your Suggestions