Hi, I have installed the Maplibre geolocation “hack” from git hub. I have created a website using the listinghive theme and hivepress plugin. So far I just have the original listings. On a PC browser the maps work fine. Categories show a larger scale map and listing show the street. On a tablet also works fine. However on my mobile I am getting a map centred around Africa in both cases. BUT if if rotate the phone to landscape works fine. So it’s not phone or browser settings. Any ideas what’s wrong. Tried in both Chrome and Firefox on Android. Thanks in advance.
Thanks for your message — our team will reply shortly.
In the meantime, you can also get instant help from our AI Assistant, familiar with all the docs and solutions we’ve shared over the years.
Hi @Charlesbabbage,
I don’t use this hack myself, but @xbelmondo may be able to assist, if he’s still active on the forums, etc.
Original topic: - Add other types of maps
Cheers,
Chris
Hi,
Unfortunately, we can’t help with custom plugins or non-official solutions, but maybe @MickaMalko can help.
Hi @Charlesbabbage
Thanks @kseniia
This map centered on Africa behavior is almost always the default MapLibre fallback center (0,0) showing because the map is initializing before its container has its final size in mobile portrait mode.
When you rotate to landscape, the browser triggers a real resize/orientation change, and then MapLibre recalculates correctly which is why it suddenly works.
Fix: force a resize + re-fit AFTER the map is fully loaded/visible (not immediately at init). In the MapLibre fork/common.js, try wrapping your fitBounds in a load/idle callback and call resize first, e.g.:
- map.once(‘load’, () => { map.resize(); map.fitBounds(bounds, …); })
- also call the same on orientationchange with a small timeout (200–300ms)
If you’re using any optimization plugin (JS delay/defer/minify), also try excluding the MapLibre and hivepress-geolocation scripts from “delay JS”, because changing the init timing can trigger this exact first-paint sizing issue on mobile.
Cheers from Paris
Thank you very much, appreciated. I will give it a try, but I’m no expert.
Hi @MickaMalko. I hope you don’t mind me asking you a question about the MapLibre hack? It’s not about the same thing as what was asked in this thread. I don’t know how you and others are able to use MapLibre. I installed it, and followed the instructions. When I add a listing and enter part of the address in the location field, it provides a suggestion, which is great. But when I click on the suggestion, only the first part, which is the street name, remains in the box. So if I type lets say ‘Park Lane, Mayfair, London’ it provides an address, but when I select the suggested address, only ‘Park Lane’ remains in the box. This is using a desktop computer with Chrome and Firefox.
Also, when using this MapLibre hack, the regions function doesn’t work at all. It doesn’t generate region pages like when using Google and MapBox. Also, when trying to edit the location field after the listing as been added, it gives an error when the ‘Generate regions from locations’ is selected. It says the region is incorrect. If I uncheck the box for Generate regions’ I don’t get that error. Either way, the same problem always exists that the location entered disappears and only the street name remains. Do you have any ideas why this could be happening? I disabled 3rd party plugins, but no change. I would really appreciate your help. Thanks.
@MickaMalko, even though I didn’t hear back from you, I thought it’s worth mentioning that it seems to be an issue with only certain addresses and in certain locations where the text disappears. So this might not be an issue, depending on the country. Even when the box is unchecked for ‘Hide the exact address’ it still does remove it, only leaving the street name. This at least happens with some UK addresses. When the user sees the rest of the address disappear, they might assume it’s not working properly. Maybe there isn’t a fix for this.
Regardless, the ‘Generate regions from locations’ function doesn’t work with MapLibre, at least with the latest version of Hivepress Geolocation. Anyone know why?
I really like Hivepress and the people behind it, and don’t like to criticise, but the map situation is very bad. Anyone running a large site won’t want to enter their credit card details and use MapBox as they could get hit with a large bill. It also puts people off wanting to get as many views as possible for fear of paying for something which isn’t viable as a business cost. All my competitions are using OpenStreetView, no one running an ordinary site wants to enter their credit card details and potentially pay for maps. I think Hivepress would sell more addons if they didn’t put people off with the map situation. Just my take, and no hate meant.