[ka-Map-users] Controlling the number of points using addObjectGeo

Base Bloc chris at basebloc.com
Tue Feb 28 08:59:30 EST 2006


Thanks for the ideas guys. Paul, I have been thinking about ways to limit
the hit, I think even a couple of hundred could slow things down as the
pop-up window will contain a few snippets of data as well a thumbnail image,
although each pop-up will be less that 5k, times that by two hundred and
it's starting to add up to a lot of data.

I thought about only running the query at a set scale, but as I see it using
this approach it is still going to have to download every point within the
extent of the mapfile in a single hit. What I was hoping to do is utilize
the variable that must be sent to mapserver to initialize a zoom to a new
scale and extent or at least check if that area and scale are cached
already. Then use that variable to query the database and return the markers
for the desired area. I guess that if the tiles for the map are already
cached on the client-side there will be some lag adding the points to the
map but I'm sure this would be more user friendly than grabbing all of the
points in one go. I'm happy at getting stuck into ka-map and Ajax if what
I'm suggesting sounds possible within the existing ka-map platform, I have a
similar system working with a non-Ajax mapserver front end which I have
made, but obviously that is a different kettle of fish as every query goes
back to the server regardless.

Regards,

Chris

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christopher Brown
Head of Internet Development
Base Bloc Cambodia
#33, 123, Phnom Penh, Cambodia. 
P.O. Box 2086
www.basebloc.com
Tel (+885) 12 315 302


-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca] 
Sent: 28 February 2006 19:56
To: Base Bloc
Cc: ka-map-users at lists.maptools.org
Subject: Re: [ka-Map-users] Controlling the number of points using
addObjectGeo

Chris,

the number of tiles loaded by ka-Map is limited to the number needed  
to fill the viewport plus a small buffer.  This is typically between  
16 and 36 depending on the size of the viewport (per group).  These  
images are just re-used when the user pans and the image sizes never  
change, even when you zoom so its pretty efficient.  Using  
addObjectGeo creates a new DOM element every time (img, div) and  
positions it over the map images.  This can be very efficient for a  
small number of objects (less than a couple of hundred) but I would  
imagine it would get pretty bad for many images both in loading and  
in the responsiveness of the browser when dragging.

If you really have a lot of data, you might want to consider using  
Lorenzo's stuff or possibly Tim's.  Both are looking at ways of  
incorporating realtime data into a single tiled layer by having the  
layer rendered on the server side, thus avoiding this problem of  
addObjectGeo.

Alternately you could limit the results returned to a set number, or  
only turn on the display of the points when the user zooms to a scale  
that makes it sensible to display them in this way.

Cheers

Paul

On 28-Feb-06, at 4:08 AM, Base Bloc wrote:

> Dear all,
>
>
>
> First off I would like to say that ka-map 0.2 is a fantastic piece  
> of kit and thanks for all the work that people have put in to this.
>
>
>
> I am currently building an application using 0.2 and I am using the  
> addObjectGeo function to add markers along with mouseover events  
> (pop-up windows) to the map. All is working as it should and is  
> looking good. My concern now is the number of markers; the  
> application is covering most of Southeast Asia and the number of  
> markers is going to be high. I am looking to use Ajax to connect to  
> a MySQL database to retrieve the point data relevant to the area of  
> the map being viewed, as if all of the points were to be retrieved  
> in one go it would result in a serious performance hit for the user.
>
>
>
> I'm no ka-map expert, but I was wondering how ka-map does this  
> efficiently with the tiles; as in it gets x number of tiles closest  
> to the area being viewed then moves outwards, is there anyway to  
> use the variable(s) that are being sent to the server to request  
> the tiles to also query the database and return the point data in  
> an equally efficient manor?
>
>
>
> Thanks in advance for your thoughts.
>
>
>
> Chris
>
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Christopher Brown
>
> Head of Internet Development
>
> Base Bloc Cambodia
>
> #33, 123, Phnom Penh, Cambodia.
>
> P.O. Box 2086
>
> www.basebloc.com
>
> Tel (+885) 12 315 302
>
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+








More information about the ka-Map-users mailing list