Sunday, May 08, 2011

Zoom tooltip hack

Average users don't care about zoom level numbers, but some people do. Developers do.

I created a 'semihidden' zoom level display for my pages. Google provides hints like "zoom in" and "zoom out" if you hover the zoom control element (slider). I thought that average map users already know those things.

Try hovering zoom slider of the first quadtree example page. Yes, hovering the zoom slider will display also meters/px resolution. That is an extra bonus for those who are interested in the World.

Have a look in the source code. It is commented there as "zoom tooltip hack". Feel free to copy the hack, if you like it. You can molest the code any way you like.  Shall this post be the license.

Thursday, May 05, 2011

Distance Matrix

Distance Matrix service was introduced in the latest update of v3 API. It returns maximum 100 driving distances and durations by a single request. Reference.

All of you who have a store locator, can now add true driving distances and estimated driving times in search results. Also you can filter out results that exceed a distance limit. If user searches by 100 km radius, you may want to return only results that have a true driving distance less than 100 km.

It is like driving directions without directions. Some people have tried to implement something similar by making multiple driving distance requests. Many of them faced problems with the asynchronous responses not coming back in the same order that requests were made. The new service is very simple to use.

It has travelMode option too. So it can be used for walking distances in city maps.

This is a useful service.

Thursday, April 28, 2011

Quadtree

Quadtree is a powerful spatial indexing technique. Wikipedia.

Every now and then I been thinking to implement a collision detect function using quadtree. Playing with quadtrees is so fascinating that I haven't got as far as collision detect, but I have a simple general quadtree demo page online. Play with it. It's inspiring.

If you are interested in experimenting, I enclosed the basic functions in QT.js library. The collision detector will be there too but I have some different applications in mind first.

Monday, March 14, 2011

Category sidebar - there is no sense without priority

Thanks for many of you that been applying the category sidebar script I wrote a long time ago for v2. Sure It works on desktop but what happens if all the entries don't fit in the limited viewport of a mobile browser?

Web has changed since. Now we have to make pages that can be used by mobile browsers too. The screen size can be equal or smaller to the first Mac.

The idea of 'gategory' is still living strong. I have extended makeMarker so that each marker has a 'cat' property. If you click one category visible, all those markers and their sidebar entries do not simply fit in view in iPhone. Also remember that mobile 'touch' devices do not support scrollbars at all. They simply cut the material! (People are shouting about Flash, hehe!)

We have to bring one more parameter to a marker - that is priority. In my current design, the default priority is the distance from map center.

The smallest mobile screen can display a sidebar with a few (<10) entries. You have to decide, which of those 1000 they are.

Ideas?