Strange issue with Google maps - we get results, but the map is wonky


We are having a very strange situation here with a customer's site. This site came to us pre-made and the customer doesn't wish to change any of the plugins and wants things a certain way and is very picky (understandably).

We are using Simple Maps and had to upgrade from a very old version. This broke their search template and we've replicated how it looked before. The search portion works fine - as in it returns relevant results. However, not only is the map off center somehow, when there are nearby results, the map is of the whole world, all the way zoomed out. When there are no results the map shows up fine. In fact, some searches ( 57006 ) shows the map zoomed in but still off center (seems to be slightly off the page to the top left).

I'm not sure what could be causing this. We've tried messing with the styles and changed our JavaScript multiple times to try different things.

Here is the page in question.

All the Google API setting seem to work fine, so I'm thinking it isn't actually it.
It returns results fine so Simple Maps seems to be pulling the data ok.
It appears to be entirely a style thing, but we can't seem to isolate it.

The settings are in a file called simplemap-master.js and I'll list em here - they are build dynamically from simplemap.

var default_lat             = 47.6913332;
            var default_lng             = -122.3824321;
            var default_radius          = 50;
            var zoom_level              = '0';
            var map_width               = '400px';
            var map_height              = '300px';
            var special_text            = 'special';
            var units                   = 'mi';
            var limit                   = '50';
            var plugin_url              = '';
            var visit_website_text      = 'Visit Website';
            var get_directions_text     = 'Get Directions';
            var location_tab_text       = 'Location';
            var description_tab_text    = 'Description';
            var phone_text              = 'Phone';
            var fax_text                = 'Fax';
            var email_text              = 'Email';

                                var sm_category_text        = 'Categories';
                                        var sm_tag_text     = 'Tags';
                                var noresults_text          = 'No results found.';
            var default_domain          = '.com';
            var address_format          = 'town, province postalcode';
            var siteurl                 = '';
            var map;
            var geocoder;
            var autoload                = 'some';

Any help, suggestions or tips are greatly appreciated!

  • ivycat
    • WPMU DEV Initiate

    Hi Phil,

    Thanks for the response!

    We haven't done the usual checks, no. Mostly because the site is live and the search worked before we toyed with the styles and added JS so we are fairly confident that there isn't any conflict in that regard. To word it differently I guess : the default Simple Map search worked fine, we changed the page style to match the old layout and now it still works but is funky in appearance.

  • ivycat
    • WPMU DEV Initiate

    So I fixed this, somehow. Actually I know how, just not entirely why.

    I changed the javascript:

    map = new GMap2( document.getElementById( 'simplemap') );


    map = new GMap2( document.getElementById( 'simplemap'), {size: new GSize(400,300) } );

    And now it works.

    Anyway, in case there is the unlikely chance it happens to somebody else.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.