fix #2863 by adding back compatibility of point symbolizer interior placement on point geometries + update visual tests
This commit is contained in:
parent
a38cc2aab6
commit
dcfa0b655c
2 changed files with 11 additions and 3 deletions
|
@ -69,17 +69,25 @@ void render_point_symbolizer(point_symbolizer const &sym,
|
|||
|
||||
mapnik::geometry::geometry<double> const& geometry = feature.get_geometry();
|
||||
mapnik::geometry::point<double> pt;
|
||||
if (placement == CENTROID_POINT_PLACEMENT)
|
||||
geometry::geometry_types type = geometry::geometry_type(geometry);
|
||||
if (placement == CENTROID_POINT_PLACEMENT ||
|
||||
type == geometry::geometry_types::Point ||
|
||||
type == geometry::geometry_types::MultiPoint)
|
||||
{
|
||||
if (!geometry::centroid(geometry, pt)) return;
|
||||
}
|
||||
else if (mapnik::geometry::geometry_type(geometry) == mapnik::geometry::geometry_types::Polygon)
|
||||
else if (type == mapnik::geometry::geometry_types::Polygon)
|
||||
{
|
||||
auto const& poly = mapnik::util::get<geometry::polygon<double> >(geometry);
|
||||
geometry::polygon_vertex_adapter<double> va(poly);
|
||||
if (!label::interior_position(va ,pt.x, pt.y))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MAPNIK_LOG_WARN(point_symbolizer) << "TODO: unhandled geometry type for point symbolizer";
|
||||
return;
|
||||
}
|
||||
double x = pt.x;
|
||||
double y = pt.y;
|
||||
double z = 0;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9a61f97dacf47f33538078a50b52122947d31caf
|
||||
Subproject commit 1bcc3238531761998109f8ee7951c2cd411b746a
|
Loading…
Reference in a new issue