-
-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
Thank you very much for this fine library.
It seems like a marker it getting shifted up the smaller the zoom is, i.e. for zoom 12 the marker position seems good. If I decrease the zoom stepwise to smaller numbers, the marker will be positioned above (and more left) of the given coordinates.
In the following images the zoom is decreased from 12 to 8, 6 and 4.
At zoom 4 the marker is almost at germanys norther border, but the coordinates point to a place way south.
My setup is rather simple
$tempFilePath = tempnam(sys_get_temp_dir(), 'osm');
$markerPath = $this->parameterBag->get('kernel.project_dir').'/assets/images/marker-black.png';
$markers = (new Markers($markerPath))
->setAnchor(Markers::ANCHOR_CENTER, Markers::ANCHOR_BOTTOM)
->addMarker(new LatLng($lat, $lng));
$map = (new OpenStreetMap(new LatLng($lat, $lng), $zoom, 640, 640))
->addMarkers($markers);
$map->getImage()->savePNG($tempFilePath);
I had a quick look at Markers::draw() but could not find the problem.
Edit: The marker anchor position does not seem to have anything to do with the misplacement.
Metadata
Metadata
Assignees
Labels
No labels