Store Locator Plus® for WordPress Forums Store Locator Plus Store Locator: Pages – Map is not showing

Viewing 25 posts - 1 through 25 (of 29 total)
  • Author
    Posts
  • #40075
    Dmitriy
    Participant

    Hi,

    I have installed SLP and SLP:Pages. Map is showing fine on general Locations Page here:

    http://talentfitness.com/thesimplegreek2/index.php/locations/

    But no maps are showing on any of the SLP: Pages generated.

    Here is code used for Pages:

    <span class=”storename”>[storepage field=store]</span>
    [storepage field=image type=image]
    [storepage field=address]
    [storepage field=address2]
    [storepage field=city] [storepage field=state] [storepage field=zip]
    [storepage field=country]
    <h1>Description</h1>
    [storepage field=description]
    <h1>Contact Info</h1>
    Phone[storepage field=phone]
    Fax[storepage field=fax]
    [storepage field=email type=mailto]
    [storepage field=url type=hyperlink]
    [storepage map=location]

     

    Can you please let me know how to fix it. Screenshot with environment is attached.

    Thank you!

     

     

    Attachments:
    You must be logged in to view attached files.
    #40139
    Cici
    Keymaster

    Your Store Pages locations urls have error messages, i.e.  failed to load resources.:

    You  have a conflict with your theme or the content added on the Store Pages added on the individual store pages another plugin added to those store pages by the looks of it.

    the individual store pages are failing i.e  json response due to the callback,  Is Your theme or another plugin forcing a jquery call back?   FAILED ERR NAME NOT RESOLVED    https://cdn.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Ftalentfitness.com%2Fthesimplegreek2%2Findex.php%2Fstore-page%2Fhighland-park%2F&callback=jQuery111305662721395339256_1459628627295&_=1459628627296

    Use Firefox debugger or the WP debugger to find the plugin causing the errors, Instructions can be found under Troubleshooting, there is also a tutorial  on the SLP You tube channel if you need to review on how to debug using Firefox

    P.S. You have a low version of PhP, WP recommended versions are 5.6 .

    Tutorial on Pages Add-on

     

     

    #40151
    Piani
    Participant

    When updating PHP go for PHP 7 direct. Its faster and no errors. Works like a charm with WordPress and Store Locator Plus.

     

    I also use the syntax

    [storepage map=”location”]

    with ” “, and that is different from what you use. Bit I use this with no problem on my site to display the map.

    #40170
    Dmitriy
    Participant

    Hi Cici, Piani

    Thank you for your reply(s). The link you provided does not work. Unfortunately Javascript / jquery and their debugging is beyond level of my expertise. I have tried reverting to another basic WP theme with no success. I have tried location with “” and without. I don’t think PHP is a problem.  In working with other paid themes’ authors if I ever had any issues they would give me a snippet of code or CSS that would correct any issues I might have had when trying all components to work together. What does it take for you to review my site and let me know how to correct the issue? Should I buy premium support? The answer above is very generic. Thank you!

    #40177
    Cici
    Keymaster

    Dmitry,

    Yes if you need the Developer to Troubleshoot and/or  logon to your site you can request with Paid Support.

    But beware, he can point you in the right direction, give you specifics  but if it is someone else’s  Plugin or your theme he will not be able to “fix it” . You might need to ask your theme developer to update the theme (you mentioned you paid him to create?)

    As far as finding out where the error is coming from using the WordPress  Debugger , there is a tutorial on that, as well as a Tutorial on using the Firefox Debugger.

    Excerpt from our Troubleshooting page:

    • Plugin Errors, any plugin that does not load properly and does ANYTHING with page header output will break and thus cause a domino effect prevent the Store Locator Plus PHP JavaScript component from loading.

    In many cases the cause of the maps not loading is because our PHP JavaScript file could not load. We can often detect this and pop-up the “PHP JavaScript connector did not load” warning. However we cannot catch all errors.

    One of the best tools for searching for errors in the HTML page headers is to use Firefox with the Firebug plugin. Turn on the console and check the responses tab for any errors. We have resolved many client installation and map problems with this plugin. More often than not we are finding errors in other plugins, themes, or server configuration settings on the servers. No, our plugin is not perfect and is not 100% bug free (we wish it were) but we are no longer finding bugs in our plugin as the primary culprit in broke installations.

    The PHP JavaScript page header is a critical part of a working Store Locator Plus installation. Since it loads very late in the page creation process it is susceptible to failures from almost anything else you may be loading on the page or your WordPress site. The the map is not loading and you are receiving this message get some page debugging/tracking tools like Firebug and isolate any plugins that are generating coding/output errors.

     

    Unfortunately there is no work around for PhP versions. S LP updated to 4.4.36 recently and Lance had to “degrade” SLP to work with lower versions of PhP so if you could update again if you havent recentlly .

    Word Press has a basic form letter to send to your hosting server at the link I provided you, here it is again

    https://wordpress.org/about/requirements/

    #40178
    Shad
    Participant

    Check to see if your Map Height Units is set to %.  Try changing to px and see if Pages map loads.

    #40179
    Dmitriy
    Participant

    Would not that be odd that map loads successfully on All Locations page and not on individual pages?

    #40180
    Shad
    Participant

    I had a similar issue and that solved it… and even now on a dev site, if I change map Height Units to a %, Pages will no longer display map.  Your environment may differ from mine, but its a quick test and possible solution.

    #40181
    Dmitriy
    Participant

    Also, when I add [SLPLUS] to any page or post of the site it loads just fine. However, if I add that to the store page post that is created by your plug in, I get Store Locator Plus did not initialize properly. To me it looks like however this store page is built (dynamically by your plugin) it is built differently from regular Pages / Posts on the site.

    Attachments:
    You must be logged in to view attached files.
    #40183
    Dmitriy
    Participant

    Changed map height / width to px – not it…

    #40184
    Shad
    Participant

    I am not the author of plugin, just a long time user of the SLP products.  Saw the post about Pages Map not displaying and thought I would share my experience.

    #40185
    Dmitriy
    Participant

    I understand! Thank you for input! Talking to Cici here 🙂

    #40189
    Cici
    Keymaster

    @Dmitry

    Whoa, back up., maybe I am understanding…Are you trying to add shortcode SLPUS]] to the individual store pages? The plug in cant work that way. It is fighting with itself and getting confused.

    That is the ingredient we are missing in solving what is going on with your site.    Please paste the full page template you have crafted

    See this Post about Pages shortcodet in the forum and the links and explanation.

    https://wp.storelocatorplus.com/forums/topic/maps-wont-load-on-store-page-archive-store-page-single-template/

    The developer further explained :

     

    ” Appears you now have an issue with Store Pages,

    You have an issue with how your Pages template is constructed.

    …………..  be advised that WordPress changed how shortcodes handle quotes. It cannot handle shortcodes with quotes for attributes within an HTML element that has quotes. There has been a lot of controversy over this move by WordPress but they refuse to change their position citing security concerns. It may require some creative templates to do what you want, but let’s start with pasting your Page template setting here.”

     

    #40190
    Dmitriy
    Participant

    This is not my intention to add [SLPLUS] to an individual store page. I was just experimenting adding it to various regular pages / posts (not generated by plugin)  and map displays with all locations. I was curious to add it to a store page to see behaviour and it does not load. The exact content of my store page is posted in my first message above.

    #40191
    Cici
    Keymaster

    Ok Dmitry..got it

    Well your test showed that it wouldn’t work , so that is consistent with what we expected….so that goes back to the error messages I saw.

    Unless I looked at it when you were fooling around with that.   I inspected one store page , more closely and

    Something is blocking the map from loading because of the errors.   I just noticed you have a contact and share form on the same page as the Store Pages and that can be interrupting the store Page, you cant have those on the Store Pages in place of some of the template elements because where the map is supposed to load is being overtaken   Not sure which Plugin if it is a social plugin or a special theme and someone added some special call methods but it is messing with the JSON call : See this error…

    Error :   cdn.api.twitter url <b>https://cdn.api.twitter.com/1/urls/count.json?</b&gt;

    Failed to load resource: net::ERR_NAME_NOT_RESOLVED

    If that is part of your theme you may need to get someone to clean that up.

    ..if you do need the developer to log on (as Shad mentioned Lance was able to find his issue by troubleshooting)

    You can send the info as you described it in the first section under Paid Support , there is something unique to your site and I cant replicate the issue at this time.   Sorry you are having trouble with this.

     

    #40194
    Dmitriy
    Participant

    I removed both, Share and Contact form and got the page to its most basic form – still not there…

    #40204
    Piani
    Participant

    Here is my complete code that works perfect. If this still not work the we have confirmed you have a problem with your site and not SLP.

     

    
    
    <font color="#008000"><b>Adress</b></font>
    
    <span class="storename">[storepage field="store"]</span>
    
    [storepage field="address"]
    
    [storepage field="zip"] [storepage field="city"]
    
    &nbsp;<br>
    
    Random text.
    
    &nbsp;
    
    &nbsp;<br>
    
    <font color="#008000"><b>Kontaktinformation</b></font>
    
    Telefon <font color="#008000"><b>[storepage field="phone"]</b></font>
    
    E-post [storepage field="email" type="mailto"]</a>
    
    Webbsida [storepage field="url" type="hyperlink"]
    
    &nbsp;<br>
    
    [storepage map="location"]
    
    &nbsp;
    
    
    #40205
    Dmitriy
    Participant

    Thank you all for suggestions!

    After contacting theme author it appears that the theme does not cooperate well with Store Page Map loading. I ended up coding map directly on Store Page.

    If anyone has this problem in the future, here is code I used to add to each store page to get the map to appear:

    <style>
    #map {
    width: 500px;
    height: 400px;
    }
    </style>
    <div id=”map”></div>
    <script>
    function initMap() {
    var mapDiv = document.getElementById(‘map’);
    var map = new google.maps.Map(mapDiv, {
    center: {lat: 44.540, lng: -78.546},
    zoom: 8
    });
    var marker = new google.maps.Marker({
    position: {lat: 44.540, lng: -78.546},
    map: map
    });
    }
    </script>
    <script src=”https://maps.googleapis.com/maps/api/js?callback=initMap&#8221;
    async defer></script>

    You can style it and adjust lat/lng based on your needs. Hope it helps someone.

     

    #40216
    Cici
    Keymaster

    Hey Dmitry,

    if you wouldn’t mind, what was your theme? Or was it customized for you?  I would like to  put a note somewhere in Troubleshooting about conflicts, especially since I will forget about this issue if someone asks two months from now.

    There are so many WP plugins, and themes , and customizations, not to mention the evr changing codex in WP that keeps everyone on their toes.. it is impossible to catch all the nuances.

    As the developer always tells me  when something doesn’t work the first and most obvious to users is that the Map doesn’t appear, its in your face and obvious…so they pretty much assume that he  broke something in SLP

    Not like   that’s never happened. ..

    🙂

    Thanks everyone , for contributing and taking time out to help your SLP community.

    #40217
    Cici
    Keymaster

    On a side note, I guess my first suggestion on the very first post about a conflict with your theme was the right answer.! That’s almost a first for me on this subject matter.

    #40218
    Dmitriy
    Participant

    The theme I have is Ronneby Theme. It was not customized for me.

    #40220
    Cici
    Keymaster

    Dmitry

    Thanks for getting back to us and for the solution.  If you feel you received fair and timely support and the base plugin is fantastic, please”

    If you like Store Locator Plus please leave a ★★★★★ rating on WordPress.org. A huge thank you from Lance and his fellow code geeks!

     

     

    #40295
    Lance Cleveland
    Keymaster

    Yes, you can force  your own map on any page using code like that you posted her but it will NOT update if you ever change your location data.  That lat/long is fixed at the position you set.

    The other issue is that you are now loading a script “inline” versus using the WordPress enqueue commands.  This is not recommended and can have all kinds of side effects as WordPress has zero information about the script and how it may impact others.

    This technique works but mileage may vary and future updates can be problematic for WordPress, Store Locator Plus, your WordPress Theme and other plugins.

    The reason your Pages map was not loading normally is because your WordPress theme (or another plugin) is loading the Google Maps JavaScript on EVERY PAGE versus just the pages it needs to render a map on.    That is also against WordPress best practices; however I understand that some themes are just too cool to pass up regardless of what bad habits they may bring with them.

    #40296
    Lance Cleveland
    Keymaster

    @Dimitiri – FYI – Pages requires WordPress 4.4 with the REST API enabled.   If you disable the REST API your pages will not pull data properly which means no location details and not map.   On one of the URLs above it appears the wpjson REST interface is disabled or has been relocated.

    #40302
    Dmitriy
    Participant

    Hi Lance,

    Thank you for your reply! I wish I got this kind of explanation and insights to my initial message. It would have saved me time. Considering what you said about negative effects of forcing map on each page, I am thinking about switching to a different theme altogether. Any themes you would recommends (contemporary  / widescreen / with sliders) that you know of, that your product works well with. I am currently considering X-The Theme.

    Thank you!

Viewing 25 posts - 1 through 25 (of 29 total)
  • You must be logged in to reply to this topic.