[Mapserver-users] Mapscript: Display points on the fly

Lowell Filak lfilak@medinaco.org
Wed, 09 Jul 2003 11:01:40 -0400


I'm not following the code syntax.
Are you saying you are trying to code PerlMapScript or trying to code
something different based on PerlMapScript examples?
Lowell 

The following message was sent by Bjoern Platzen <bplatzen@sosnetz.de>
on Wed, 9 Jul 2003 16:01:45 +0200.

> Hi,
> 
> I'm trying to display a point at the last klickpoint in the map, but it 
> doesn't appear on the map. I know that this has been discussed on the 
> list a few times, but all the Examples I found were in Perl and I'm not 
> really a Perl-programmer...
> 
> First of all, the mapObj (self.mymap) is defined and the image is 
> prepared with
> 
> self.myimage=self.mymap.prepareImage()
> 
> My function to draw the point looks like that:
> 
> def _drawPoint(self, point):
>         
>     pLayer = self.mymap.getLayerByName('onthefly')
>     pLayer.status = mapscript.MS_ON
>     newPoint = mapscript.pointObj()
>     newPoint.x, newPoint.x = point[0], point[1]
>     newPoint.draw(self.mymap, pLayer, self.myimage, 0, 'Klick')
>     self.layers.append('onthefly')
> 
> point is a tuple of the map-coordinates (eg. (2548085.3064984209, 
> 5674031.5200534584).
> 
> After _drawPoint, the function _drawLayers is called:
> 
> def _drawLayers(self):
>     for l in self.layers:
>         ll = self.mymap.getLayerByName(l)
>         str(ll)
>         ll.draw(self.mymap, self.myimage)
> 
> self.layers contains the layer-names
> 
> After that, the image is saved with
> 
> def makemap(self):
>     self.mymap.drawLabelCache(self.myimage)
>     out = 
> self.myimage.saveImage(self.imgpath+self.outname,mapscript.MS_PNG,0,0,50)
>         self.mapimg = self.imgpath+self.outname
> 
> In my mapfile, Ive got a layer 'onthefly':
> 
> LAYER
>   NAME 'onthefly'
>   TYPE POINT
>   STATUS OFF
>   CLASS
>     Symbol 'phk'#Image-Symbol
>   END
> END
> 
> What am I missing? 
> 
> Bye, Bjoern
> -- 
> small office solutions
> info@sosnetz.de  -  http://www.sosnetz.de
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users@lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users