Avada Forums Community Forum Google Maps Element showing different lat/lon coordinates than entered

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • Rich
    Participant
    Post count: 7

    I entered an address in the Google Maps element but the marker was way off. So I looked up the coordinates of the exact location and used those instead.

    But now looking at the map, the marker is still off. I inspected the source code and strange enough it shows different coordinates than I have entered in the element.

    How do I fix this?

    Michael C
    Keymaster
    Post count: 540

    Hi Rich,

    This depends on the format of the address given. If you add an address or just coordinates on their own then Google’s Geolocation will kick in to find a recognized address. However, if you want to avoid that entirely you can provide coordinates along with the string latlng. For example – latlng=12.381068,-1.492711. That should make sure the coordinates are used exactly.

    Rich
    Participant
    Post count: 7

    Thanks Michael,

    I have entered the following coordinates in the element: 40.689328, -74.044673

    However the map shows the marker at: 40.689903,-74.046258

    Which I found in the source code: https://maps.google.com/maps?ll=40.689903,-74.046258

    What is causing the difference?

    Michael C
    Keymaster
    Post count: 540

    Hi Rich,

    As I mentioned, along with the coordinates you also need to add the latlng part. So you should enter latlng=40.689328,-74.044673 rather than 40.689328,-74.044673. Have you tried that?

    Rich
    Participant
    Post count: 7

    Yes, I’ve tried “latlng=” as well, but I keep getting a different source code that puts the marker on the wrong location.

    Michael C
    Keymaster
    Post count: 540

    Where exactly on the map are you trying to focus? It is difficult to tell based on the link and therefore I cannot properly compare. However, if you zoom in you can get a more focused latng.

    For example, try adding latlng=40.6899154,-74.0462169,21z instead (this is all assuming you are using JS API)

    Rich
    Participant
    Post count: 7

    Michael,

    I would like to do the following:

    In maps.google.com I zoom in at the maximum and drop a marker and copy the coordinates.

    So in my example, this will be https://www.google.com/maps?q=40.689328,-74.044673

    I want to have these coordinates also exactly in the Avada Maps element. So I enter: 40.689328,-74.044673

    Then when I look at the page where the element is placed and zoom in to the max as well, the marker is at a different location.

    I checked the source code and I find this: https://maps.google.com/maps?ll=40.689903,-74.046258

    So I want this: https://www.google.com/maps?q=40.689328,-74.044673

    But Avada returns this: https://www.google.com/maps?q=40.689903,-74.046258

    If you zoom in at both links you can see the difference…

    P.S.
    Do you have a link/source where I can find more about the parameters you are using? “latlng=”, “21z”.

    Michael C
    Keymaster
    Post count: 540

    Hi Rich,

    In that case the original coordinates do work fine for me already. Example of using latlng like pasted – http://prntscr.com/knfkje which is the place in your example. You also have the choice of using the monument name – Statue of Liberty National Monument which will work as the address.

    For the query about the additional code, that was just copied from the address in the browser when zoomed in.

    Rich
    Participant
    Post count: 7

    Michael,

    The momument is just an example. The marker I want to use has no location or address. Just coordinates.

    I’ll show you why it does not work for me.

    So I want this: https://www.google.com/maps?q=40.689328,-74.044673

    See screenshot of marker when zoomed in:
    https://cl.ly/3a893c33c17e/Image%202018-08-27%20at%209.49.29%20PM.png

    Avada returns this: https://www.google.com/maps?q=40.689903,-74.046258

    See screenshot of marker when zoomed in:
    https://cl.ly/fb60a7ff2c8d/Image%202018-08-27%20at%209.51.24%20PM.png

    It is not the same. And I really do not understand why the source code does not put out the coordinates I enter in the element…

    Michael C
    Keymaster
    Post count: 540

    Hi Rich,

    I don’t know what else to say here. I have already shown in my last reply that the location is correct from Avada if used with the coordinates and latlng. The theme itself also does not change the address input, that is the Geolocation from Google.

    Examples with Avada:
    JS API with latlng – https://prnt.sc/knfkje
    Embed API without latlng – http://prntscr.com/knh27m

    Both are correct. So if this is not correct for you, you will need to provide more details. Which embed type are you trying to use? Are you trying to use the builder element or from theme options? What do you mean by “source code does not put out the coordinates”? Also if possible provide a screenshot of your set-up and display within Avada rather than from google maps directly.

    Rich
    Participant
    Post count: 7

    Thanks for your help Michael!

    I am doing nothing fancy: Using the Fushion Builder and Google Maps element with default Google API Type (Default currently set to JS API).

    In the address field I enter: 40.689328,-74.044673 or latlng=40.689328,-74.044673

    Publish and that’s it. Then when I look at the page the marker is off.

    This is the screenshot from the element output: https://cl.ly/5125b7d15db2/Image%202018-08-27%20at%2011.49.40%20PM.png

    I inspected the code on the page and in the source code I find this https://maps.google.com/maps?ll=40.689903,-74.046258 which mean it is using a different lat/lon than I have entered in the address field. Weird no?

    I am off for today and pick this up again tomorrow. Any ideas to fix this are welcome.

    Rich
    Participant
    Post count: 7

    Michael,

    I said: “Yes, I’ve tried “latlng=” as well, but I keep getting a different source code that puts the marker on the wrong location.”

    Today, I checked again and it works now. Maybe after changing it was still cached…

    Thanks for your help and glad it is solved!

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