• Resolved nixiemartyn

    (@nixiemartyn)


    Hi!

    I made a map on a previous site that is working as expected. However, now I am building another site using the exact same coordinates and settings as I did with the first site, but the location shown on this second map is wrong. It shows a place somewhere in Montana, when it should be in Europe. Both sites show the “Oops! Something went wrong” message, but this error only started to show up long after I developed the first site this spring.

    All the settings are the same on both maps, I also did ensure that Google Maps Javascript API is enabled.

    First (working) site: https://www.forvalter.no/kontakt-oss/
    Second site with the wrong coordinates: https://sentrumhandelsbygg.no/kontakt-oss/

    The coordinates are: 59.91894562667409, 10.70201413705945

    Thank you for your help!
    Nixie

Viewing 10 replies - 1 through 10 (of 10 total)
  • I checked the Developer Console ([F12]) on the first site (https://bit.ly/2g90Re3) and found an error message stating that you are loading the Google Maps API multiple times on the page. This is probably due to either your theme or another plugin also loading the Google Maps API.

    I also found a number of JavaScript errors related to maps.gooogle.com’s common.js file. It is possible you are loading a deprecated version of the Google Maps API. Could you verify for me what version of the Google Maps API you are loading with WP Google Maps (see WordPress Dashboard → Maps → Maps)>?

    Thanks in advance.

    Thread Starter nixiemartyn

    (@nixiemartyn)

    Hi Patricia, thanks for the quick reply!

    I checked both sites and they were both using the Google Maps API: 3.25. I changed both to 3.26 but didn’t notice any difference.

    In addition I switched the theme to the default Twenty Fifteen on the first site, and then checked the developer console. When using the default theme there was only one instance of maps.googleapis.com running. What is weird is that I am using the Genesis Framework on both sites and google api is only loading several times on the first site.

    Jarryd Long

    (@jarryd-long)

    Hi @nixiemartyn

    My apologies for any inconvenience caused.

    Unfortunately we’re quite limited to where the marker is placed on the map as the Google Maps API takes full control over that.

    What I can however suggest, is to perhaps edit the marker, and drag it into the correct position.

    Please let me know if this helps?

    Thread Starter nixiemartyn

    (@nixiemartyn)

    Unfortunately I am not able to do drag the marker to the correct position, since I can’t even see the map in the admin area. I get the error message “Oops! Something went wrong. This page didn’t load Google Maps correctly. See the JavaScript console for technical details.”

    Error message - Oops! Something went wrong.

    By the way, I get this error on both sites, but the coordinates show thw wrong location only on one of the sites even with the same plugin settings and coordinates.

    Thread Starter nixiemartyn

    (@nixiemartyn)

    The WP Google Maps Error log shows: “No errors to report on”

    I also doublechecked that all the APIs were enabled in the Google dashboard:
    Google Static Maps API
    Google Maps JavaScript API
    Google Maps Embed API
    Google Maps Geocoding API

    When I check the main API manager dashboard there are a number of reported errors for Google Maps Embed API and Google Static Maps API. (9 errors, 100% error ratio). However, if I check this APIs individually by clicking directly from the main manager dashboard to the Embed API and Static Maps API there are no reported errors? (Client errors (4xx): 0)

    What is weird is that I am using the Genesis Framework on both sites and google api is only loading several times on the first site.

    I’m not a Genesis expert, but is there anywhere in the Settings or Customize panels where you might have told the theme to load Google Maps API on one site, but not on the other? Thanks in advance.

    Thread Starter nixiemartyn

    (@nixiemartyn)

    I haven’t found an option for that anywhere in the Genesis settings.

    To troubleshot I checked on both sites the WP Google Maps option: “Do not load the Google Maps API (Only check this if your theme loads the Google Maps API by default).”

    On the first site the map was still there after checking this option. However, on the second site (that was showing the wrong coordinates) the map disappeared altogether.

    Since starting to figure out this problem I noticed that the first site that was showing the right coordinates tend to freeze the browsers whenever I go to that url. (For Chrome and Firefox). This didn’t happen before, but last time I checked must have been months ago. There have been some updates to Genesis and the Dynamik framework since then. I don’t know if this is the issue. I can try to setup a fresh install on a different host later.

    Jarryd Long

    (@jarryd-long)

    Hi @nixiemartyn

    Please right click on the page when you’re in the map editor, click ‘Inspect Element’ and then on the ‘Console’ tab so that we can see what sort of JavaScript errors and Google Maps API errors are occurring?

    Thread Starter nixiemartyn

    (@nixiemartyn)

    Hi Jarryd!

    This fixed the problem with the coordinates. Thank you all for your help and quick responses!

    Here is what I found to be the problem:
    I found two errors, one of them were: “Google Maps API error: RefererNotAllowedMapError”

    https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error

    I renamed the URL in the Google API Dashboard to the root of my domain and then added an asterix instead of using the exact url to the page with the map. This made the map to load in the WP Google Map editor and I could move the position to the exact marker as you advised. The marker was already there from earlier.

    In Google API Dashboard I set the URL to:
    https://domain/*

    Instead of:
    https://domain/map/
    https://domain/

    I also found a second error in the console tab, but this does not effect the location of the map.
    “A Parser-blocking, cross-origin script is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity.”

    https://maps.google.com/maps/api/js?v=3.exp&key=AIzaSyBiWJIePHZcefkjLPUCkUbdzajyvs0d1xQ&language=en_US

    Thank you for your help!

    Jarryd Long

    (@jarryd-long)

    Hi @nixiemartyn

    So glad to hear you came right with this!

    The ‘Parser-blocking, cross-origin script’ error will be resolved in an upcoming release as this occurs due to the way we load the Google Maps API – as you said, this won’t affect the map’s functionality or ability to place markers on it.

    Just shout if there’s anything else we can assist you with ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Coordinates show the wrong location.’ is closed to new replies.