Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M mapnik3
  • Project information
    • Project information
    • Activity
    • Members
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
Collapse sidebar
  • 周峰
  • mapnik3
  • Wiki
  • Mapnik2_Changes

Mapnik2_Changes · Changes

Page history
clone mapnik wiki from github. authored May 14, 2021 by 周峰's avatar 周峰
Hide whitespace changes
Inline Side-by-side
Mapnik2_Changes.md 0 → 100644
View page @ 8516de00
<!-- Name: Mapnik2/Changes -->
<!-- Version: 21 -->
<!-- Last-Modified: 2011/11/16 09:31:04 -->
<!-- Author: artem -->
# Changes between Mapnik 0.7.x and Mapnik 2.0
## XML
## Global Changes
### Underscores --> Dashes
All properties that previously used underscores, ie '_' now use dashes ('-'). So, for example: 'allow_overlap' is now 'allow-overlap'
* Mapnik 0.7.2 has compatibility with both syntaxes as of r2579
* Mapnik 2.0 moved to only dashes in r2582
* properties changed include:
```python
['paths_from_xml','minimum_version','buffer_size','face_name,fonset_name','clear_label_cache','vertical_alignment','halo_fill','halo_radius','text_ratio','wrap_width','wrap_before','wrap_character','text_transform','line_spacing','label_position_tolerance','character_spacing','min_distance','minimum_distance','avoid_edges','allow_overlap','max_char_angle_delta','horizontal_alignment','justify_alignment','unlock_image','no_text']
```
### CSSParameters --> Properties
This change affects the PolygonSymbolizer, LineSymbolizer, RasterSymbolizer, and BuildingSymbolizer only.
All CSSParameters have been removed, so for example, this:
```xml
<PolygonSymbolizer>
<CssParameter name="fill">yellow</CssParameter>
</PolygonSymbolizer>
```
is now:
```xml
<PolygonSymbolizer fill="yellow" />
```
## Changes by Element
### Map
| *component* | *old* | *new* |
|------------------|---------------|--------------------------|
| Map | bgcolor | background-color |
| Map | did not exist | background-image |
### Symbolizers
| *component* | *old* | *new* |
|------------------|---------------|--------------------------|
| TextSymbolizer | name='field' | name='[field]' |
| TextSymbolizer | text_convert | text-transform |
| TextSymbolizer | min_distance | minimum-distance |
| TextSymbolizer | did not exist | minimum-padding |
| PointSymbolizer / PolygonPatternSymbolizer / LinePatternSymbolizer | width | removed |
| PointSymbolizer / PolygonPatternSymbolizer / LinePatternSymbolizer | height | removed |
| PointSymbolizer / PolygonPatternSymbolizer / LinePatternSymbolizer | type | removed |
# Python API
| *component* | *old* | *new* |
|------------------|---------------|--------------------------|
| mapnik | mapnik.Envelope | mapnik.Box2d |
| TextSymbolizer | set_displacement (function) | displacement (property) |
| TextSymbolizer | first argument was string | first argument now mapnik2.Expression('[field]') |
| ShieldSymbolizer | first argument was string | first argument now mapnik2.Expression('[field]') |
| ShieldSymbolizer | fifth argument was string | fifth argument now mapnik2.PathExpression('/path/to/[field].png') |
# C++ API
| *component* | *old* | *new* |
|------------------|---------------|--------------------------|
| mapnik::Map | getWidth | width |
| mapnik::Map | getHeight | height |
| mapnik::Map | zoomToBox | zoom_to_box |
| mapnik::Map | setBackground | set_background |
| mapnik::Map | getCurrentExtent | get_current_extent |
| mapnik::Map | zoomToBox | zoom_to_box |
| mapnik:: | mapnik::Layer | mapnik::layer |
| mapnik:: | mapnik::Envelope | mapnik::box2d |
| mapnik:: | mapnik::ImageData32 | mapnik::image_data_32 |
| mapnik:: | mapnik::Image32 | mapnik::image_32 |
| mapnik:: | mapnik::Image8 | mapnik::image_8 |
| mapnik:: | mapnik::rule_type | mapnik::rule |
| mapnik:: | mapnik::create_filter | mapnik::parse_expression |
# Planned/Proposed Before Release
## Python API
* Image.tostring -> Image.encode()
* All remaining uses of 'envelope' -> 'box2d' (like ds.envelope())
Clone repository
  • A perfect testcase
  • API changes between v2.0 and v2.1
  • API changes between v3.0 and v3.1
  • AWS Lambda
  • About Mapnik
  • AlsoFilter
  • Api changes between v2.1 and v2.2
  • Api changes between v2.2 and v2.3
  • Api changes between v2.3 and v3.0
  • ArchInstallation
  • Aspect Fix Mode
  • Benchmark Notes
  • BoundsClipping
  • BrokenExceptions
  • BuildingSymbolizer
View All Pages