@@ -38,7 +38,6 @@ class CoordinatesPlaceMapper implements PlaceMapperInterface
3838{
3939 use PlaceMapperTrait;
4040
41- private ?string $ cache_key = null ;
4241 private ?GeometryEngine $ geometry_engine = null ;
4342
4443 /**
@@ -82,7 +81,7 @@ public function map(Place $place, string $feature_property): ?string
8281 $ features_index ['map_SW ' ],
8382 $ features_index ['nb_columns ' ]
8483 );
85- if ($ grid_box === null || !$ this ->setGeometryEngine () || $ this ->geometry_engine == null ) {
84+ if ($ grid_box === null || !$ this ->setGeometryEngine () || $ this ->geometry_engine === null ) {
8685 return null ;
8786 }
8887 $ features = $ features_index ['grid ' ][$ grid_box [0 ]][$ grid_box [1 ]];
@@ -128,7 +127,7 @@ protected function getGridCell(Point $point, Point $grid_NE, Point $grid_SW, int
128127 /**
129128 * Get an indexed array of the features of the map.
130129 *
131- * {@internal The map is divided in a grid, eacg cell containing the features which bounding box overlaps that cell.
130+ * {@internal The map is divided in a grid, each cell containing the features which bounding box overlaps that cell.
132131 * The grid is computed once for each map, and cached.}
133132 *
134133 * @phpcs:ignore Generic.Files.LineLength.TooLong
@@ -211,13 +210,10 @@ protected function setGeometryEngine(): bool
211210 */
212211 protected function cacheKey (): ?string
213212 {
214- if ($ this ->cache_key === null ) {
215- $ map_def = $ this ->data ('map ' );
216- if ($ map_def === null || !($ map_def instanceof MapDefinitionInterface)) {
217- return null ;
218- }
219- return spl_object_id ($ this ) . '-map- ' . $ map_def ->id ();
213+ $ map_def = $ this ->data ('map ' );
214+ if ($ map_def === null || !($ map_def instanceof MapDefinitionInterface)) {
215+ return null ;
220216 }
221- return $ this -> cache_key ;
217+ return spl_object_id ( $ this ) . ' -map- ' . $ map_def -> id () ;
222218 }
223219}
0 commit comments