prepareImage() || draw()

Sean Gillies sgillies at FRII.COM
Fri Jan 21 11:17:06 EST 2005


Aaron, I'm cc'ing the list so that this gets into the archive.

mapObj::draw() effectively calls prepareImage during execution, but no
other drawing method does.  So if you to use pointObj::draw(),
shapeObj::draw(), or layerObj::draw() you will need to first create a
blank image canvas with mapObj::prepareImage().  If you are very
careful you might even use an imageObj produced by the imageObj
constructor, but prepareImage is safer and manages all the spatial
re-sizing and re-scaling that may be necessary.

Sean

On Jan 21, 2005, at 8:54 AM, Aaron Craig wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Okay, I understand that.  To avoid hardwiring the style, etc. for the
> layer, I am changing the code to
>
> lyrObj = mapObj->getLayerByName("lines");
>
> where lines is a layer described in the mapfile.
>
> However, I am still unclear about the internal workings.
>
> If I do
> imgObj = mapObj->prepareImage();
>
> will subsequent changes to the extent of the mapObj, etc. be
> recognized,
> or do the properties of the map get copied into the imgObj when it is
> created (I am suspecting this latter).
>
> If that's the case, then I suppose the logic should be:
> create map object
> make all changes to the map object
> get image
> save image
>
> which makes me wonder what the use of prepareImage() is...
>
> Sean Gillies wrote:
> |
> | Aaron, your inline layer needs classes and styles for symbolization
> of
> | the shape.  Also, only add features to the layer *after* you've
> inserted
> | it into the map.  Remember, MapServer cannot deal with map elements
> by
> | reference and so insertLayer makes a *copy* in the mapObj.  You'll
> need
> | to add features to that copy and not to the original layer.
> |
> | Sean
> |
>
> - --
> Aaron Craig
> mercutio at pobox.com
>
> ===========================================================
> Get Firefox!
> http://www.spreadfirefox.com/?q=affiliates&id=0&t=1
> ===========================================================
>
>
> - -=-=-
> All that lives must die, passing through nature to eternity -- Hamlet,
> Act i, Sc.2
> - -=-=-
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFB8SXSoyEQRcU83p4RAhIxAJ98h4qRMvcEh7DL/nA2utCmvuES5QCfaniV
> QByzzlXbBvBXTizH9DJiJBY=
> =xw5g
> -----END PGP SIGNATURE-----
>
>
--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the mapserver-users mailing list