This version of the page http://www.panoramio.com/blog/latest-developments/ (0.0.0.0) stored by archive.org.ua. It represents a snapshot of the page as of 2008-08-17. The original page over time could change.
Latest developments at Panoramio

Panoramio's Blog


Latest developments

January 17th, 2006 by Joaquín Cuenca Abela

Being featured in Google Earth gave me the energy to code some long overdue changes to Panoramio.

First, I put a common header in the user and photo pages, so that users can jump directly to their pictures, to the home page, and sign out / sign in easily. I remember Johan said sharing the header will improve the feeling of “being part of Panoramio” (the words are mine). I still have to find someway to integrate this header in the home page… I hope you like it, because I tried several ideas and I passed several hours in The Gimp to do it.

Now you also have RSS feeds in the user’s page, so you can follow the photos of your favourite users from bloglines or your favourite aggregator. And speaking about favourite users, you can now add users to your favourites clicking on their star or add them using the input box in the right column if you are logged (Actually, I put the RSS feeds and favourite’s users a while ago, but I have not blogged about it).

I also improved a bit the algorithm to choose the photos to display in Google Earth, and raised the number of photos downloaded when you stop over an area.

And something Eduardo was begging for a while, a way for people to spread the word about Panoramio. Now (only when logged) you will have in your right column a “show these photos to a friend” link. That will let you spa^H^H^H tell your friends how great is Panoramio.

On the bad news, you can see that when you use sign in / sign out / stars it works reloading the page, so the results are not as smooth as they can be. At first I had a full javascript solution working, but there were too many bugs. There are just too many things to coordinate to keep these 3 things fully in javascript, so by now I will let the server-side fallback do its job. Later I will javascriptize the stars (I don’t think sign in / out are really worth the effort).

Well, I hope you like these things, because they sucked away my week-end and latest evenings (again!)

This evening I decided to code a bit on the javascript engine. I have fully finished variable instantiation now. It was not yet done, that why I was using that weird “var a = function fact(x) { … }” instead of just “function fact(x) { … }”.

Now the TODO is starting to look reasonable…

  • Unicode support
  • Track correctly line numbers for errors
  • Human readable error messages
  • Fix string to number conversions
  • Handle efficiently big sparse arrays (firefox also has this bug)
  • toLocaleString is not just toString…
  • Build a pretty-printer and use it instead of the compressor for js_function_to_string
  • Fix arithmetic that uses uint32
  • Implement real objects for standard Errors (right now I’m throwing string objects)
  • Joined objects
  • Implement Array.prototype.concat and Array.prototype.reverse
  • Implement all the native objects, right now I only have Object, Function and Array (and their prototypes, constructors, instances, etc.). This TODO item is big.
  • Label sets support
  • New expressions (this is the last expression not yet implemented, probably just a few minutes to make it work)
  • Run the SpiderMonkey regression tests, cry and fix bugs

Well… it looked reasonable in my head.

Update:
New expressions are now fully implemented:

function test_constructor(a) { this.hello = a; }
var o = new test_constructor(”world”);
var st = “”;
for (var i in o)
    st += i + ” ” + o[i];
st;

gives

"hello world"

Btw, do you know of any plugin to colorize javascript code in WordPress?


11 Responses to “Latest developments”  

  1. 1 Johan Sundström

    The header is nice indeed, and I absolutely love the login lightbox hack. The star functionality isn’t very opaque, though; just something as simple as adding a title=”brief feature description” attribute to the star image would help up usability substantially.

    Another tiny feature suggestion that just struck me: some way of recentering and zooming the view to neatly fit all the map markers for the selected view filter would be nice. I e, if a user only has pictures in Venice, Italy, it would zoom the view on Venice, whereas a user with pictures from most corners of Africa, would show a larger subset of the Earth for this function. I’ve seen the method a few times on the Google Maps group (and it seems to come with the native maps 2 API, too), if you don’t already have your own zoomToBounds or similar method.

  2. 2 Johan Sundström

    The “in a map” link would be a very good candidate for defaulting to that zoom, if you decide on implementing it, if perhaps not exposing it elsewhere in the page interface. (Which might start building up featureitis mold on a very clean and easy to use interface.)

  3. 3 Joaquín Cuenca Abela

    Hi Johan!

    I have title=”Remove from favourites” on highlighted stars and title=”Add to favourites” on non highlighted stars.

    Am I missing a title somewhere?

    As for the zoomToBounds, sure, I thought about it some days ago, but someway it got out of my head. I will put it in the “in a map” link asap (I have some unstable changes committed to my repository, and I want to stabilize these before).

    Thank you for your comments Johan!

    Cheers,

  4. 4 Johan Sundström

    Actually, you have an alt attribute saying that. The alt attribute is for an alternative representation of the image to non-image-rendering browsers, and will not be rendered by web standards compliant browsers under any other circumstances. Internet Explorer (and perhaps other browsers too), incorrectly renders these as captions on hovering the element. The attribute standardized to have that effect is “title”, which will work in Mozilla and Opera too. While I am not nearly standards advocate enough myself to mind those alt attributes, I would suggest adding the title attribute too.

  5. 5 Joaquín Cuenca Abela

    Ops, my fault.

    To add insult to injury, I even remember an old bug in mozilla about using alt text for tooltips if there was no title (afair it degenerated on a big flamefest).

    I’ll patch it with the next row of fixes.

    Thank you Johan!

  6. 6 Joaquín Cuenca Abela

    I implemented a zoomToBounds like feature, but in PHP.

    The methods I found on the google maps discussion group were “start proving zooms untils you find one in which all the markers fit” (in javascript).

    That’s extremelly inefficient. If you know the size in pixels of your map you can do much better.

    I derived the equation:

    $zoom = ceil(25 + max(log($lt_delta / $map_height / 180, 2), log($ln_delta / $map_width / 360, 2)));

    to find the zoom in function of the latitude / longitude delta you want to enclose.

    I’m putting it here in case it helps somebody.

    Cheers,

  7. 7 Johan Sundström

    Oh, I thought it was just a simple

    var center = new GPoint( (maxLng + minLng)/2, (maxLat+minLat)/2 );
    var delta = new GSize(maxLng - minLng, maxLat - minLat);
    var minZoom = map.spec.getLowestZoomLevel(center, delta, map.viewSize);
    map.centerAndZoom(center, minZoom);

    or map.getBoundsZoomLevel in forthcoming API version 2.31.

  8. 8 Joaquín Cuenca Abela

    If you can do it in javascript, then yes, you can use getLowestZoomLevel.
    I’m however reusing the main page for showing the user photos, and the only data that I can pass to the home is the center, the zoom, the user number, etc. I don’t want to add many more arguments (maxLng, minLng, maxLat, minLat).

    One could argue that you can call the above javascript if the user number is different from 0, but that will break somewhat backwards compatibility and complicate even more the startup of the home page. Currently it has to decide what coordinates to take: those passed in “get” like params for backwards compatibility with old links, those passed in the hash (for new links), those stored in the cookies, or a mix of these three? I was not feeling like adding another layer of possible coordinates.

    On the backwards compatibily problem, right now a link to www.panoramio.com/#user=x directs the user to a map in the position and the zoom that he was using last time he visited Panoramio, showing only x’s photos. Not to the center of x’s photos. It’s not a big deal, but together with the previous point, it convinced me that it was best to just put the coordinates directly in the link.

  9. 9 Joaquín Cuenca Abela

    Oh, btw, it should be noted that I didn’t remembered until your post getLowestZoomLevel, that’s why I searched in the google maps group, and it seems (judging by the solutions I found) I was looking at the wrong place

  10. 10 Johan Sundström

    By the way, I think you might like my latest Greasemonkey user script.

  11. 11 Joaquín Cuenca Abela

    Hey, great little script Johan!

    Oh, btw, I have been following your blog for a while. Great work with your SVG Challenge. Just in case you’re interested, I think the font Scott used on its chart is Trebuchet MS bold.

    The lack of subpixel positioning in firefox will make the rendering worse than the photoshop’s one, but you will get closer than with your current font.

Leave a Reply


For spam detection purposes, please copy the number 7645 to the field below:

  • Archives

    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
  • Categories

    • css (2)
    • html (8)
    • Interaction Design (6)
    • javascript (11)
    • miscellaneous (25)
    • new features / improvements (63)
    • panoramio (49)
    • personal (2)
    • places (25)
    • Uncategorized (5)