Re: Map zoom effect "a la Google"

5 views
Skip to first unread message

Joseph Gentle

unread,
Oct 1, 2008, 11:26:03 PM10/1/08
to olivier brand, route-...@googlegroups.com
I've been procrastinating doing this because I'm not so sure how to
implement it.

I know ways I could implement it; but I'm not sure which way is best.

The problem is how to work out which tiles to remove when the zoom
changes. I guess there's a few options:

1) The tileimages each store references to the tile they're replacing.
When a big tile replaces 4 little tiles, it knows which 4 tiles it
replaces and when that tile has loaded the other tiles are removed.
When all 4 smaller tile overlays on a big tile, the big tile keeps a
reference count or something around and that counts down to 0 at which
point the tile is removed.
Bad stuff: This seems unnecessarily fiddly and expensive - every
on-screen tile needs to store another reference count and an array.

2) When any tile loads we do a scan through all tiles currently on the
screen to see if they can be removed.
Bad stuff: This method has n^2 complexity. If we move to 64
pixels-per-side tiles, it might start getting expensive.

3) When the zoom level changes all previously loaded tiles are moved
to 'the background' of sorts. When all tiles in the foreground have
loaded, everything in the 'background' layer is dumped.
Bad stuff: If the user never lets all the screen tiles load (they
constantly move around, rezoom, etc) then the background set will just
keep growing unbounded.


What do you guys think? I'm not really sure how I should proceed.

-J


On Thu, Oct 2, 2008 at 1:08 PM, olivier brand <obra...@gmail.com> wrote:
> Joseph,
>
> I saw a few improvements in the speed of tile loading since I sent you an
> email on this last week. However, I can still see the zoom not working as
> Google does it, being zooming the bitmap until the user releases the
> fingers. The zoom works for about a fraction of seconds and then stop and
> being replaced by the grey grid.
> Do you think you will get the behavior as expected or are you focusing on
> other things right now?
>
> I believe this would dramatically improve the user experience.
>
> Thanks
>
> B-
>

jfujita

unread,
Oct 2, 2008, 12:52:40 PM10/2/08
to route-me

What about option 3 with a timer that starts/resets itself on the
user's pinch/zoom gesture. the OnTimer result would dump the
background layer and prevent the stacking of tiles.

Also, This issue does not bother me too much. I think the addition of
markers/overlays/polygons would more drastically add to the utility of
this component.

Best,
Justin

Brother

unread,
Oct 6, 2008, 6:30:31 PM10/6/08
to route-me
I was thinking of something easier but correct me if I am wrong here:

While the user is zooming in, the only thing you should do is zoom the
displayed bitmap using Quartz APIs.
When the user finishes zooming, then you can start to load the tiles
on top of the zoomed bitmap.

In a way there is nothing to load in the background:

Step 0 - You always take a bitmap snaphot of the current screen when
after any activities (load, zoom in, zoom out, move...)
Step 1 - The user starts to zoom in
Step 2 - You take the previously taken snapshot and apply a Quartz
zoom until the user releases the fingers from the screen.
Step 3 - You start to load the tiles on top of the Zoomed bitmap
Step 4 - When all tiles are loaded, you take a snapshot of the map
(same than step 0).

Does it make sense?

Matt Farnell

unread,
Oct 6, 2008, 8:31:54 PM10/6/08
to route-...@googlegroups.com
just a thought, as I'm sure you are aware there are a number of apps
on the app store that do this using the MS Visual earth tiles, maybe
its worth emailing in the MS maps forum or the maps team to see if
they have any advice/code to fast track you. I'd say its at least
worth an email.

Jonathan Wight

unread,
Oct 7, 2008, 10:29:50 AM10/7/08
to route-...@googlegroups.com
The primary reason to use MSVE is because MS actually documents their
tile system rather well. Yes, you will be using MSDN to help develop
iPhone software :-)

I've made an open source MSVE map engine available as part of
TouchCode (see http://toxicsoftware.com/touchmap-teaser/ and http://toxicsoftware.com/touchmap/)
. The code needs some loving (esp. in the zoom) but can form the basis
of your map engine.

Jon.

Brother

unread,
Oct 8, 2008, 10:58:33 AM10/8/08
to route-me
Jonathan,

Is the primary reason to use MSVE is as well for Microsoft to generate
some form of revenue?
What is the licensing agreement if someone release an application
using the Microsoft tile engine in the Apple AppStore? If the
application is given for free on the appstore, do we still need to pay
$$$ to Microsoft? Is that an open license?

Thanks for helping the development community

B-


On Oct 7, 7:29 am, Jonathan Wight <jwight_li...@toxicsoftware.com>
wrote:
> The primary reason to use MSVE is because MS actually documents their  
> tile system rather well. Yes, you will be using MSDN to help develop  
> iPhone software :-)
>
> I've made an open source MSVE map engine available as part of  
> TouchCode (seehttp://toxicsoftware.com/touchmap-teaser/andhttp://toxicsoftware.com/touchmap/)
> . The code needs some loving (esp. in the zoom) but can form the basis  
> of your map engine.
>
>         Jon.
>
> On Oct 6, 2008, at 5:31 PM, Matt Farnell wrote:
>
>
>
> > just a thought, as I'm sure you are aware there are a number of apps
> > on the app store that do this using the MS Visual earth tiles, maybe
> > its worth emailing in the MS maps forum or the maps team to see if
> > they have any advice/code to fast track you. I'd say its at least
> > worth an email.
>

Jonathan Wight

unread,
Oct 8, 2008, 11:36:43 AM10/8/08
to route-...@googlegroups.com
The primary reason to use Microsoft VE was because MS had the best
documentation. It was much easier to work with something that was
defined than to reverse engineer google or yahoo or whoever.

I am not a lawyer, but it is my understanding that using the MSVE tile
server is free for non-commercial use. You'll want to go check the
license agreements and everything before you do so of course.

TouchMap _is_ a work in progress and a lot more needs to be done.
There has been some talk of switching from MS to Google or Yahoo tile
servers. I'd love for someone to help with that.

Jon.

Joseph Gentle

unread,
Oct 8, 2008, 12:18:14 PM10/8/08
to route-...@googlegroups.com
Are the protocols really that complicated?

Yahoo, Microsoft, Google and OpenStreetMaps all use the same
coordinate system for their tile images. Each application simply has
its own mapping of tile (int x,y,zoom) to URL.

Here's a tile in openstreetmaps (numbers are zoom/x/y):
http://a.tile.openstreetmap.org/15/30149/19669.png

In google maps (notice x=&y=&z=)
http://mt2.google.com/mt?v=w2.83&hl=en&x=7536&y=4915&z=13&s=Gal

a tile in microsoft maps: (They have their own encoding function which
they document)
http://t0.tiles.virtualearth.net/tiles/r3112301330200.png?g=203&mkt=en-au

in yahoo maps (sadly they don't have detailed maps of sydney): (and
again its x=&y=&z=)
http://us.maps1.yimg.com/us.tile.maps.yimg.com/tl?v=4.1&md=2&x=235&y=-26&z=9&r=1


If you can handle one map system it shouldn't take more than a couple
lines to implement another mapping system.

-J

Reply all
Reply to author
Forward
0 new messages