Labeling dynamically, Support in germany?
Daniel Morissette
danmo at videotron.ca
Fri Sep 22 07:19:56 PDT 2000
Christian wrote:
>
> Hello,
> I have a mapscript/php running now and we want to label a map dynamically
> with some "bars" created on the fly out of a database. Has somebody already
> done some experiments with this?
>
Christian,
I'm assuming that you want to draw vertical bars as a symbol at point
locations, with a bar height defined by an attribute from the database,
right?
If that's what you want to do, then I don't think there is an automated
way to do it in MapServer. However, with MapScript, you can
dynamically create shapes and draw them on top of your map. In this
case you would use the rectObj's draw() method. You would also have to
add a layer to your map with the classes that you want to use to draw
your bars.
After calling $map->draw(), you would use PHP to retrieve the points
from your database, and for each point:
- calculate the location and size of the bar: (x1,y1)-(x2,y2)
- create a rectObj and call its draw method:
$rect = ms_new_Rect();
$rect->setExtent($x1, $y1, $x2, $y2);
$rect->draw($map, $layer, $img, "class_name", "");
Now, this may not work with older versions of PHP MapScript as there was
an unitialized variable in the rect->draw() method that I just fixed.
The version 3.3.012 that will be released in the next days should be
fine though.
> Is here somebody that could provide us with commercial/professional service
> within Germany?
>
We (DM Solutions Group, http://www.dmsolutions.on.ca/) do that kind of
things (and more!)... developing/supporting Open Source stuff is fun,
but we also have to pay the bills! :)
We would probably not go on site in Germany (even though I would not
mind going :), but with the wonders of the Internet, it does not really
matter where we all are... mostly for web development. We have clients
all over Canada and we don't travel on site all the time!
Regards,
--
------------------------------------------------------------
Daniel Morissette danmo at videotron.ca
http://pages.infinit.net/danmo/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list