Store Locator Plus® for WordPress › Forums › Store Locator Plus › Prevent center map relocation when no results in SLP
- This topic has 8 replies, 2 voices, and was last updated 5 years, 10 months ago by Cici.
-
AuthorPosts
-
January 25, 2019 at 10:29 AM #58510AleksandarParticipant
Hello,
Plugin environment:
- Store Locator Plus®:5.0.3
- Site URL:https://www.marlec.co.uk
- This Info Cached:1547647283
- Network Active:No
- WordPress Version:5.0.3
- PHP Version:5.6.27
- MySQL Version:5.5.61
- PHP Limit:256M
- WordPress General Limit:64M
- WordPress Admin Limit:256M
- PHP Peak RAM:98 MB
- PHP Post Max Size:108M
Google API keys are generated and added to SLP.
On page https://www.marlec.co.uk/where-to-buy-solar-iboost/ we have customized theme for SLP. If you search for some UK post code (for example NG1 4FQ or CB3 0GP) you’ll get results from local SLP locations database with listed locations and pins on map, map is centered properly.
Now, if you search for some keyword that does not exists in local SLP database, for example “Kettering”, then instead of table with locations you’ll get message “No locations found.” which is correct, but you’ll also get map centered to USA within area where Kettering city is located.
We don’t wish this to happen, but instead simply leave map empty and re-centered to initial canter_map_at location (defined in plugin settings). We do not wish to center map to some location which does not exists in local SLP database.
Please note, if we define “slplus.options.map_region” to be “uk” instead of undefined (we inject that option after SLP is initialized), then in case when keyword does not exists in local SLP database, we get results located around initial center_map_at lat/long, so that feature from Experience addon does not help.
So, is there some setting or option in any of premium addons to prevent re-centering map for non-existing locations and lock it only to local SLP database?
Thank you in advance,
Aleksandar
- This topic was modified 5 years, 11 months ago by Aleksandar. Reason: Fix HTML formatting from plugin details
January 25, 2019 at 6:28 PM #58521CiciKeymasterAlex,
Could you provide me the exact site url where the map loads so I can visualize what you are asking?
If all your locations are in UK you can use the append feature with experience add-on and it will show the areas only in UK but it will not go back to your center map at. Once the search has initiated on the site the google geocoding API kicks in.
Just using the Map domain as UK is not going to restrict searches to just that map domain you are correct. That is not how Google works.
You can help your customers out with experience add-on by providing the discrete search function
With Premier there is a limit by territory feature but it does not sound like that is what you are looking for. There is also a boundary influences guesses, but that will not limit the locations exclusively to the data set to recenter. Other option is to limit the results radius settings and radius behavior
January 30, 2019 at 7:51 AM #58565AleksandarParticipantHi Cici,
I sent message with more detail but that message did not appear here. Can you please check is there some message waiting to be moderated?
Btw, SLP map is on page https://www.marlec.co.uk/where-to-buy-solar-iboost/
Thanks,
AlexJanuary 30, 2019 at 11:38 AM #58575CiciKeymasterOk, I did a search on the page you provided a link and using dev tools to inspect site and errors saw this error:
Uncaught ReferenceError: mtfgf_settings is not defined
at HTMLDocument.eval (eval at <anonymous> (jquery.js?ver=1.12.4:2), <anonymous>:1052:9)
at i (jquery.js?ver=1.12.4:2)
at Object.add [as done] (jquery.js?ver=1.12.4:2)
at n.fn.init.n.fn.ready (jquery.js?ver=1.12.4:2)
at a.fn.init.n.fn.init (jquery.js?ver=1.12.4:2)
at new a.fn.init (jquery-migrate.min.js?ver=1.4.1:2)
at n (jquery.js?ver=1.12.4:2)
at HTMLScriptElement.c (main.min.js?ver=1.10.25:1)
at HTMLScriptElement.dispatch (jquery.js?ver=1.12.4:3)
at HTMLScriptElement.r.handle (jquery.js?ver=1.12.4:3)
That could be an issue
February 5, 2019 at 8:46 AM #58620AleksandarParticipantHello Cici,
I was unable to follow up here in forum last week because forum software complain about missing author name and email address. I hope now it will work and I can send comment.
I was disabled plugin “Magic Tooltips For Gravity Forms” which caused that JS error. Unfortunately, behaviour is same – when “Kattering” keyword is searched and properly returned only message “No locations found”, map is zoomed to Kattering city in US.
Can you please test again?
Thanks,
Alex
February 6, 2019 at 1:47 PM #58636CiciKeymasterUnfortunately, without additional settings such as an append search Goolge is going to return what they think is meant by kettering should be Kettering ohio.
They need more information then just a word if there are more then one location in the world that can have a specific search associated with it. They will return the best option in their opinion. The only work around to what Google is going to guess that we have are search enhancement option in Premier subscription or the Enterprise level plan in MYSLP. In MYSLP we can add Kettering to the database with a lat and long to return and it would search the dataset in MYSLP first.
But with the WPSLP free plugin you are at the mercy of google. If you do not think Append is viable for you, then what about discrete searches?
I am not trying to sell you something you do not need, but all the plugins that require Google MAPs APIs are limited to what Google will return and a lot of man hours have been put into the addons by developers to try and work around the google limitations and interpretation of what to return with their millions of algorithms which change on a regular basis (see article the developer recently posted about Google tweaking algorithms and in essence Moving Kansas City..
February 7, 2019 at 9:39 AM #58643AleksandarParticipantHi Cici,
Thank you very much for detailed response. I’ll summarize to client what options are available, and if client wish to go with some paid addon, they will purchase it.
I can not remember did this worked same before Google introduced required Maps API or map was intact in case when SLP does not find any match in own locations database.
Wishing you all the best,
Alex
February 7, 2019 at 5:32 PM #58647CiciKeymasterNo idea, but Google has always been constantly changing the algorithms. Example as explained by the developer, Google moved Kansas City
February 8, 2019 at 4:50 PM #58672CiciKeymasterThe developer is also revisiting the function setting the map domains. He thinks there may have been an error when he fixed the “map region” in a previous version. We need to test the new SLP release and will let you know. If you want to test it (if you have a staging or dev site to test on) we can send you a pre release via email.
Let us know if you have s somewhere to test the slp 5.0.4.04 beta
-
AuthorPosts
- You must be logged in to reply to this topic.