GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to select the GMap zoom level (or bounding box) for an admin region or city  XML
Forum Index -> General
Author Message
tohagan



Joined: 13/04/2011 12:08:19
Messages: 2
Offline

I'm familiar with how to select the GMap zoom level to ensure that a given bounding box is displayed. This works fine for GeoName country records that include the bounding box. For admin regions I can make very rough guess using their child nodes but for leaf nodes like cities there appears to be no obvious method.

What method would you recommend for selecting the right GMap zoom level for cities?

Thanks for GeoNames!
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

I would try to make an educated guess with feature code and population. A feature with featureClass 'S' (Spot) has a small footprint and a big city with a huge population must have a large footprint.

Marc

[WWW]
tohagan



Joined: 13/04/2011 12:08:19
Messages: 2
Offline

Thanks Marc.

Do you know of any code samples that computes the correct zoom levels. I suspect that the zoom level also needs to be also based on the pixel dimensions of the map.

Thanks again,
Tony.
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

I don't think that a magic formula exists that works everywhere. Just try a little what makes sense in your particular case and implement a simple rule of thumbs.

Best

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team