[ka-Map-users] RE: ka-Map-users Digest, Vol 10, Issue 28

Brent Pedersen bpederse at gmail.com
Wed Mar 1 11:06:22 EST 2006


hi stephen,
it seems we're saying the same thing.  the url i sent only redraws markers
if current extents pass out of an expanded extent.
your way would definitely be a lot cleaner implemented as a core ka-map
event as you suggest.
-b

On 2/28/06, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
>
> Hi Chris,
>
> I think what needs to be done here it that you need to maintain extents
> of the loaded tiles (the padded extents) which is like the viewport plus
> the additional tiles surrounding it, call this the META_EXTENTS because
> the EXTENTS_CHANGED event will get triggered on every pan. Then in the
> event you need to check if the viewport extents has moved outside of the
> META_EXTENTS. If not then your done, if it has you need to reset the
> META_EXTENTS based on the current position and zoom scale and request
> and update via Ajax.
>
> This way panning within the META_EXTENTS will not request new data from
> the server, but moving outside the META_EXTENTS or a zoom event will
> trigger a request for more data.
>
> -Steve W.
>
> Base Bloc wrote:
> > Hi Brent,
> >
> > This sounds like a good way to do this for me as the number of markers
> that
> > would be displayed for my application would never be more than 50 within
> a
> > padded viewport at the required scale.
> >
> > I apologize I haven't yet had the opportunity study the inner workings
> of
> > ka-map so am not familiar with all the functions yet; what your
> suggesting
> > is building a new function that uses an existing function called
> > getGeoExtents to find the extent of the current viewport (which can then
> be
> > padded for optimum results) then sending these variables back to the
> server
> > to query the database via an Ajax call to return the relevant markers.
> This
> > function will be set in motion if EXTENTS_CHANGED is true?
> >
> > Thanks, this sounds like a solid yet simple solution, do you have any
> > working code that you can share with us, or a demo of this in action?
> >
> > Thanks,
> >
> > Chris
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Christopher Brown
> > Head of Internet Development
> > Base Bloc Cambodia
> > #33, 123, Phnom Penh, Cambodia.
> > P.O. Box 2086
> > www.basebloc.com
> > chris at basebloc.com
> > Tel (+885) 12 315 302
> >
> > -----Original Message-----
> > From: ka-map-users-bounces at lists.maptools.org
> > [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of
> > ka-map-users-request at lists.maptools.org
> > Sent: 01 March 2006 00:00
> > To: ka-map-users at lists.maptools.org
> > Subject: ka-Map-users Digest, Vol 10, Issue 28
> >
> > Send ka-Map-users mailing list submissions to
> >       ka-map-users at lists.maptools.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >       http://lists.maptools.org/mailman/listinfo/ka-map-users
> > or, via email, send a message with subject or body 'help' to
> >       ka-map-users-request at lists.maptools.org
> >
> > You can reach the person managing the list at
> >       ka-map-users-owner at lists.maptools.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of ka-Map-users digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: Controlling the number of points using addObjectGeo
> >       (Brent Pedersen)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Tue, 28 Feb 2006 07:48:51 -0800
> > From: "Brent Pedersen" <bpederse at gmail.com>
> > Subject: Re: [ka-Map-users] Controlling the number of points using
> >       addObjectGeo
> > To: ka-map-users at lists.maptools.org
> > Message-ID:
> >       <e183a99d0602280748y7bb7c176k6fbf1f1d42de5599 at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > hi, a super simple version of this has been useful to me. just via
> calling
> > kaMap.getGeoExtents, then pad that (so it adds ~1/2 length of the
> viewport
> > on each side) and fetch
> > all of the markers in that expanded extent. then register for an event
> of
> > EXTENTS_CHANGED and check
> > if the new getGeoExtents results fall with the expanded extents. if so,
> do
> > nothing. otherwise, fetch new markers.
> >
> > base, most of the slowness will come from having 500+ images attached to
> > your div. but you can assign an AJAX (call()) to each div to fetch the
> meat
> > of the information instead of sending it with the inital marker import.
> if
> > you have the div id correspond to database id, that keeps it simple.
> > -brent
> >
> > On 2/28/06, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
> >
> >>Paul Spencer wrote:
> >>
> >>>Ok, then the event could be triggered as a result of the call to
> >>>checkWrap and if any wrapping has occurred you would get an event
> >>>indicating the new extents of the meta viewport.  You could then make
> >>>your overlay image the size of the meta viewport (in pixels) and
> pin  it
> >>>to the top/left image in the meta viewport.  When this event is
> >>>triggered, you would reposition the image and change its source so it
> >>>would load a new overlay from the server.
> >>>
> >>>Are you going to implement this and contribute?
> >>
> >>Matt has been working on this, but I think he is currently pinning an
> >>image just the size of the viewport so we have to request a new one for
> >>every pan. I think the plan is to contribute some of the stuff he has
> >>been working on, but I don't know any of the details.
> >>
> >>-Steve
> >>
> >>
> >>>Cheers
> >>>
> >>>Paul
> >>>
> >>>On 28-Feb-06, at 9:23 AM, Stephen Woodbridge wrote:
> >>>
> >>>
> >>>>Hi Paul,
> >>>>
> >>>>These get called for every tile load request if I understand your
> >>>>description, if I pan diagonally then I would expect to get rows
> >>>>+cols-1 (or more) events triggered as you add new rows and columns  to
> >>>>the meta_viewport.
> >>>>
> >>>>I think this a little too granular, but we might be able to roll up
> >>>>these events. What I was thinking about was to consider the
> >>>>additional tiles around the viewport as a meta_viewport that has
> >>>>extents. Then when the viewport moves outside the meta_viewport a
> >>>>single event is triggered and the new extents of the meta_viewport
> >>>>are made available.
> >>>>
> >>>>If it is easy to get this from what you suggested below then that
> >>>>would be great other you might consider add this type of event as I
> >>>>think anyone trying to track an overlay with a server side image  will
> >>>>be able to use this.
> >>>>
> >>>>-Steve
> >>>>
> >>>>Paul Spencer wrote:
> >>>>
> >>>>
> >>>>>Steve,
> >>>>>I think that we should expose two events:
> >>>>>KAMAP_TILE_CHANGING
> >>>>>KAMAP_TILE_CHANGED
> >>>>>this would potentially allow the interface to expose the number  of
> >>>>>tiles that are 'in the queue' and could be used for other  purposes
> >>>>>to, like fixing overlays etc
> >>>>>KAMAP_TILE_CHANGING would be triggered in the setTile method of
> >>>>>_layer (and affliates).
> >>>>>KAMAP_TILE_CHANGED would be triggered in the kaMap_imgOnLoad function
> >>>>>One thing to consider is that images do fail to load for various
> >>>>>reasons and we need to be aware of the difference between an  image
> >>>>>that is loaded the first time and an image that is loaded  because
> >>>>>of  an error, otherwise tile counts could be seriously  impacted.
> >>>>>Would this meet your needs?
> >>>>>Cheers
> >>>>>Paul
> >>>>>On 28-Feb-06, at 7:58 AM, Stephen Woodbridge wrote:
> >>>>>
> >>>>>
> >>>>>>This is an excellent question as we have been doing something
> >>>>>>similar with router overlays. We currently overlay an image just
> >>>>>>the size of the viewport, but it would make sense to ask for a
> >>>>>>larger image say the size of the preloaded tile extents and then
> >>>>>>only update that when additional tiles are requested because the
> >>>>>>preloaded tile extent needs to change because of panning or
> >>>>>>zooming. Could this be made an ka-map event that can be
> >>
> >>easily  hooked?
> >>
> >>>>>>-Steve
> >>>>>>
> >>>>>>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
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>_______________________________________________
> >>>>>>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/|
> >>>>>+-----------------------------------------------------------------+
> >>>>
> >>>>
> >>>+-----------------------------------------------------------------+
> >>>|Paul Spencer                           pspencer at dmsolutions.ca   |
> >>>+-----------------------------------------------------------------+
> >>>|Applications & Software Development                              |
> >>>|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> >>>+-----------------------------------------------------------------+
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>_______________________________________________
> >>ka-Map-users mailing list
> >>ka-Map-users at lists.maptools.org
> >>http://lists.maptools.org/mailman/listinfo/ka-map-users
> >>
> >
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL:
> >
> http://lists.maptools.org/pipermail/ka-map-users/attachments/20060228/75ba8c
> > 17/attachment-0001.html
> >
> > ------------------------------
> >
> > _______________________________________________
> > ka-Map-users mailing list
> > ka-Map-users at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/ka-map-users
> >
> >
> > End of ka-Map-users Digest, Vol 10, Issue 28
> > ********************************************
> >
> >
> > _______________________________________________
> > ka-Map-users mailing list
> > ka-Map-users at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/ka-map-users
> >
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060301/fa24ef75/attachment-0001.html


More information about the ka-Map-users mailing list