Open Street Map Wrong Location With Custom Image - Question | JoomShaper
SP Page Builder 6 is Here! Learn More →

Open Street Map Wrong Location With Custom Image

Paulie

Paulie

SP Page Builder 4 years ago

When I use the Open Street Map addon with the latest version of SP Page Builder Pro (v3.7.9) and add a location with a "custom marker" it displays the location as expected. Then if I zoom in or out on the map, the location is not locked to the map and drifts a great distance from the set location. The location is only valid at the original "zoom" setting.

This seems to be a bug. Can it be fixed?

0
8 Answers
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #5789

Hi there,

Thanks for contacting us. Sorry for the inconvenience. Please follow the instructions.

Go to the file location

components/com_spproperty/assets/js/spmap.js

Find out the code

api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}

Replace with this code

api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}

-Thanks

0
Paulie
Paulie
Accepted Answer
4 years ago #5902

Thak you for your response but "components/com_spproperty/assets/js/spmap.js" does not seem to exist. I cannot locate "com_spproperty" folder or "spmap.js" file anywhere.

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #5980

Please provide me the FTP access & Joomla administrator access via hidden content area. Thanks

0
Paulie
Paulie
Accepted Answer
4 years ago #6118

This is a SP Page Builder bug, it is not specific to my installation and does not require you to have private access to my site. This problem occurs with latest Joomla + latest SP Page Builder Pro.
Create a new page in SP Page Builder and add the Open Street Map addon. Add a location but instead of using the default location marker, add a custom marker. Apply these settings then preview your map. The location marker is displayed at the proper location but when you zoom out of the map, the marker ends up moving miles from the specified location. It is not locked to the proper location like when the default marker is used.

Starting location (custom marker and default marker)... https://reelmedia.org/test/spmap1.jpg

https://reelmedia.org/test/spmap3.jpg

Where the marker should be after zooming out (customer marker and default marker)... https://reelmedia.org/test/spmap2.jpg

https://reelmedia.org/test/spmap4.jpg

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #6158

Please create a page in this URL and share the link. I will share with our developer.

0
Paulie
Paulie
Accepted Answer
4 years ago #6286

Page has been created. Thanks.

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #6328

Got it. This is not our fault. This problem comes from Openstreet map. Thanks

0
Paulie
Paulie
Accepted Answer
4 years ago #6414

Looking at the copyright at the bottom iof the map it suggests you are using the Leaflet API. This API allows the Anchor point to be specified...

var myIcon = L.icon({
    iconUrl: 'my-icon.png',
    iconSize: [38, 95],
    iconAnchor: [22, 94],
    popupAnchor: [-3, -76],
    shadowUrl: 'my-icon-shadow.png',
    shadowSize: [68, 95],
    shadowAnchor: [22, 94]
});

If SP Page Builder does not provide a way to adjust the anchor point then it seems it is NOT a problem of OpenStreet Map. Please look at the map again as I have placed a default marker at the exact same location as the custom marker. When you zoom out you can see where the anchor point is of both the default and the custom marker and you can see that the anchor of the custom marker needs to be adjusted to function properly.

0