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

Lowell Filak lfilak at medinaco.org
Wed Jul 9 11:30:32 EDT 2003


I understand.
I don't know Python but there are at least a couple of people on the
list that know both that should be able to help.
Lowell

The following message was sent by Bjoern Platzen <bplatzen at sosnetz.de>
on Wed, 9 Jul 2003 17:03:14 +0200.

> Hi Lowell,
> 
> sorry, that I didn't mention...
> 
> I'm coding Python based on the Perl-Examples.
> 
> I never coded Perl (just Python, PHP, VB), so it is a kind of hard for 
> me to understand what all that perl stuff means...
> 
> But I could solve my problem meanwhile.
> 
> Thanks,
> 
> Bjoern.
> 
> Am Mittwoch, 9. Juli 2003 17:01 schrieb Lowell Filak:
> > 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 at 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 at sosnetz.de  -  http://www.sosnetz.de
> > >
> > > _______________________________________________
> > > Mapserver-users mailing list
> > > Mapserver-users at lists.gis.umn.edu
> > > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 
> -- 
> small office solutions
> info at sosnetz.de  -  http://www.sosnetz.de




More information about the mapserver-users mailing list