Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to making a webpage where the user pans and zooms on a map, and based on the location and zoom level, some data is displayed on the webpage (drawn from another source). The data that will be displayed is not spatial data, and it will not be shown on the map. I thought I could have a database for each zoom level, and then when a call to the database is made, it returns the data associated with that location and zoom level.

I saw an approach on the google earth documentation regarding regions and this related SE question. However, I was hoping to use Google maps for this.

The data being returned for each area is just one number. For example, say I wanted to see the number of people in a certain area, it would show that value on the webpage. The first iteration of this I was hoping to do for a city (London), and then see if there were any performance issues.

Is this a reasonable approach? Are there any better ways of doing this, or things that I should be aware of?

share|improve this question
If your data is "not spatial data" how are you relating it to a location or area on the map? – Regan Sarwas Dec 11 '10 at 16:33
I meant to say that the resultant data is not spatial (just a number) but it is associated with a spatial area. I suppose it's the same as getting a value from an attribute table of a spatial object. – djq Dec 11 '10 at 16:41
up vote 3 down vote accepted

You could use a Google Maps Map where you listen to the bounds_changed event of the Map object (see Google Maps API).

When you get that event you can access the map.getBounds() to receive the bounds of the visible area in the map and the map.getZoom() to get the current zoomlevel.

If you have the data you want to displayed coded with locations you could retreive data from the other source that fits the current bounds and the current zoomlevel and display to the user.

share|improve this answer
Thanks Peter, that is exactly what I am planning on doing. However, I'm not sure whether it is reasonable to do this for large areas and wonder if there are any good programming strategies to implement this. – djq Dec 11 '10 at 16:43
If you add indexes on your datastore (preferably spatial indexes) you can easily do this strategy for huge datasets. Use some kind of spatially enabled DB-backend (SpatialLite, MySQL, Postgresql/PostGis, SqlServer 2008, Oracle Spatial etc.) – Peter Dec 11 '10 at 17:45
@Peter: how does a spatial index work in general, and for something like this? This is the type of issue I am hoping to learn about as I've never made a large database like this before (and realize it is ambitious). – djq Dec 11 '10 at 17:53
Spatial indexing is often implemented as some kind of quadtree or RTree index on a Spatial Column in the database. The ones i mentioned does support spatial indexing natively. For example when using mysql you can create and index like: CREATE SPATIAL INDEX sp_index ON geom (geomcolumn); Where geom column is a column storing some kind of spatial indentifyer.. point, link, rectangle etc. When querying data you can then do: select colname,.. from table where MBRIntersects(spatcolumn,GeomFromText('Polygon((30000 15000,31000 15000,31000 16000,30000 16000,30000 15000))')) – Peter Dec 11 '10 at 18:13

You can use Fusion Tables to display non-spatial data with spatial data on Google Maps

An Example is on Google Maps Mania

You can control the 'region' by setting a SELECT statement with a defined Rectangle. [so you can define London MBR]

SELECT 'Store Name', Name, Address FROM 292905 WHERE ST_INTERSECTS(Address, RECTANGLE(LATLNG(37.0242,-122.2806), LATLNG(37.5242,-121.6806))) ORDER BY Store Name

See Keir Clarke example [this uses ORDER BY ST_DISTANCE can be changed to RECTANGLE]

share|improve this answer
I am considering Fusion Tables, but I would prefer to store the data in a way that I do not have to make it all public due to some copyright issues. – djq Dec 11 '10 at 17:52

I am trying to create search functionality on move map according to center point of map want to get result. you can see example like Please do need full for me .

share|improve this answer
Welcome to GIS SE! Please ask a new question by selecting the Ask Question option instead of answering with one. You can always link your question with this topic by including the web address. – Joseph Aug 13 '14 at 12:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.