[ka-Map-users] Dynamic points on the map, can you help please?
Daniel.Huber at ch2m.com
Daniel.Huber at ch2m.com
Wed Oct 17 22:57:00 EDT 2007
> -----Original Message-----
> From: ka-map-users-bounces at lists.maptools.org
> [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of The Bun
> Sent: Wednesday, October 17, 2007 3:11 AM
> To: ka-map-users at lists.maptools.org
> Subject: RE: [ka-Map-users] Dynamic points on the map, can
> you help please?
>
>
> Hi Daniel
>
> Again my reply is not passed for some reason. Anyway I sorted
> out the server side dynamic points, in a similar way as you
> suggested, starting with a layer with no connection in the
> mapfile, I failed to have something fully dynamic ( ie
> creating a layer on the fly ) but it is OK.
>
>
>
> > I used this approach and it works well, except I had to figure out
> > how to make mine dynamic for each user, since they did not want
> > anybody else seeing their data.
> >
>
> Well, I have the same problem, each user may have ( and see )
> different points and the map. I thought of two solutions: One
> is to adapt the server side to cache tiles for sessions
> instead for application but this may compromise performances,
> server space and add complexity. The other one is adding
> client side objects ( as you suggested in the other post )
> and implement everything in JavaScript, yes, because I don't
> only have to mashup data I also need to query my dynamic data
> ( by clicking on the points for example ) and showing extra
> text information, I mean I may need to expand kamap class
> storing coordinates and texts and need to implement something
> clever in order to show the text related to a point when the
> user click on the point itself. I really don't know which
> direction to take .... what do you think?
>
> Anyway the discussion is open and I'd really appreciate any
> contribution.=)
>
> Kind Regards
> Rosario
Rosario,
I've not had a need to interact with the data on the map so I don't know
the "best" method for querying the dynamic points in ka-Map. Hopefully
others will chime in for that need.
While I'm sure there are simpler methods for creating dynamic data
layers, this is what I ended up doing.
1. Generate a new mapfile using the a unique name.
Info on unique names found here:
http://us3.php.net/manual/fi/function.rand.php#74351
2. Set the path to that mapfile to a PHP session variable
$_SESSION['mapFile'] = 'path.name.of.mapFile';
3. Modify the "config.php" to always point to the new mapfile if it is
set.
if ($_SESSION['mapFile']) {
$aszMapFiles['dynamic']['path'] = $_SESSION['mapFile'];
}
To ensure my dynamic layers were not cached, I set the following
METADATA tag for the layers in the mapfile: "tile_source" "nocache"
Hopefully this is enough to get you going, although I'm sure I left off
some key points as I haven't messed with this code in 3 months.
Good luck!
Daniel
More information about the ka-Map-users
mailing list