Skip to content

Add MAP class diagram - #196

Merged
havatv merged 3 commits into
MapServer:branch-7-0from
geographika:map-object
Sep 21, 2017
Merged

havatv merged 3 commits into
MapServer:branch-7-0from
geographika:map-object

Conversation

@geographika

Copy link
Copy Markdown
Member

Image resized to have a width of 1024 pixels. The original is at https://github.com/geographika/mappyfile/blob/master/docs/images/map_classes.png

The image was created for the FOSS4GE mappyfile presentation, using MapServer colours.

To regenerate the image the script is available at https://github.com/geographika/mappyfile/blob/master/docs/scripts/class_diagrams.py

A preview is available at https://mapserverdocs.s3.amazonaws.com/mapfile/map.html

@havatv

havatv commented Sep 19, 2017

Copy link
Copy Markdown
Contributor

Thank you, @geographika!
This is is a very useful illustration. But I am not sure if the _static directory is the right place for the full image (map_classes_full.png). I would think that the image directory could be the right place. I will let @jmckenna decide.

@jmckenna

Copy link
Copy Markdown
Member

@havatv is correct, the image should live in the /en/images/ directory.

@geographika

Copy link
Copy Markdown
Member Author

I tried the following RST but the target image isn't copied across when building (the resized smaller image is fine):

.. image:: ../images/layer_classes.png
    :align: center
    :target: ../images/layer_classes_full.png

The :scale: property works, but requires pillow to be installed, and the image is a little more blurred:

.. image:: ../images/layer_classes.png
    :align: center
    :scale: 80%

Maybe I can drop the full sized image completely?

@havatv

havatv commented Sep 20, 2017

Copy link
Copy Markdown
Contributor

As far as I can tell, :target: has not been used for images in the image directory before, so I am not sure how it is done.
You could try the following for the target: _images/layer_classes_full.png
../_images/layer_classes_full.png might also work.

@geographika

Copy link
Copy Markdown
Member Author

I've tried several ways but it doesn't seem like it is supported. See https://stackoverflow.com/a/13075141/179520

The only 3 options appear to be:

  • leave the larger image in static (the resized image is already in /en/images/
  • add pillow to requirements.txt and use the :scale: tag (this takes care of resizing and clickable link)
  • remove the full size image available when clicking on the smaller version

Let me know which option best suits the project.

@havatv

havatv commented Sep 20, 2017

Copy link
Copy Markdown
Contributor

I tried to link to an image located in /images from construction.txt in the en/mapfile/symbology directory, and this works for me in a local build::

 .. figure:: ../../images/carto-elements.png
   :height: 400
   :width: 600
   :align: center
   :target: ../../_images/symcon-overlay.png

@geographika

Copy link
Copy Markdown
Member Author

@havatv - thanks for that suggestion. The main issue was that the image file doesn't get copied automatically from the /image/ folder to the built /_images/ folder when using the :target: directive.
However I can manually set the width and height on the image, and link to itself via the _images folder as suggested.

@havatv

havatv commented Sep 21, 2017

Copy link
Copy Markdown
Contributor

@geographika, I did not see that problem - but you solved it nicely!

@havatv
havatv merged commit a724915 into MapServer:branch-7-0 Sep 21, 2017
@havatv

havatv commented Sep 21, 2017

Copy link
Copy Markdown
Contributor

Thank you for this very useful contribution, @geographika!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants