Map defaults to different geolocation

Home Forums MapPress Support Map defaults to different geolocation

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19455
    morten
    Participant

    Hi,

    Just noticed a disturbing behavior: A saved map defaults to a different geolocation to that of the saved one. The saved is 12.5758466667, 54.02833, but displayed location is the first that matches the first digit – namely 1. This displays A20 Tessin – Thelkow in Germany, not Socotra. See here: https://www.ross.no/2015/02/12/skant-at-night-socotra/ – when you zoom out and move east to Arabian peninsula, you will see the geolocation pin on the island of Socotra that should be centered..

    If I create a new map with same geolocaction the map is displayed correctly. Problem is that the bad map is used in many, many posts, and I don’t know how many other maps are affected by this bug..

    Version 2.74.3

    Morten

    #19456
    Chris
    Keymaster

    Hi,

    I took a look, and what’s saved in the map is actually “54.0204685,12.5635314”.  It looks like it’s displaying correctly, but the latitude and longitude were reversed.

    #19457
    morten
    Participant

    Hi,

    Deleting coordinates and reentering them in UI will not fix the issue. Only way is a workaround I do not want – creating a new map/ID and update all the posts using this one.

    What causes this, and how to fix it?

    This is what’s in the database for the problem mapid:

    “O:12:”Mappress_Map”:11:{s:5:”mapid”;s:3:”438″;s:6:”center”;a:2:{s:3:”lat”;d:54.0204685;s:3:”lng”;d:12.5635314;}s:6:”height”;N;s:9:”mapTypeId”;N;s:7:”metaKey”;N;s:4:”pois”;a:1:{i:0;O:12:”Mappress_Poi”:10:{s:7:”address”;N;s:4:”body”;s:34:”<p>Haghier Mountains, Socotra</p>
    “;s:16:”correctedAddress”;N;s:6:”iconid”;N;s:5:”point”;a:2:{s:3:”lat”;d:12.5758466667;s:3:”lng”;d:54.02833;}s:4:”poly”;N;s:3:”kml”;N;s:5:”title”;s:23:”12.5758466667, 54.02833″;s:4:”type”;N;s:8:”viewport”;N;}}s:6:”search”;N;s:6:”status”;N;s:5:”title”;s:26:”Haghier mountains, Socotra”;s:5:”width”;N;s:4:”zoom”;i:12;}”

    When creating a new map that is working correctly it looks like this:

    O:12:”Mappress_Map”:11:{s:5:”mapid”;N;s:6:”center”;N;s:6:”height”;N;s:9:”mapTypeId”;N;s:7:”metaKey”;N;s:4:”pois”;a:1:{i:0;O:12:”Mappress_Poi”:10:{s:7:”address”;N;s:4:”body”;s:0:””;s:16:”correctedAddress”;N;s:6:”iconid”;N;s:5:”point”;a:2:{s:3:”lat”;d:12.5758466667;s:3:”lng”;d:54.02833;}s:4:”poly”;N;s:3:”kml”;N;s:5:”title”;s:23:”12.5758466667, 54.02833″;s:4:”type”;N;s:8:”viewport”;N;}}s:6:”search”;N;s:6:”status”;N;s:5:”title”;s:26:”Haghier Mountains, Socotra”;s:5:”width”;N;s:4:”zoom”;N;}

     

     

    #19460
    Chris
    Keymaster

    Hi,

    I see – the POI lat/lng is in the right place, but the center is reversed.

    How do you output the map, with a shortcode, Gutenberg block or PHP?  Please paste your shortcode or PHP here.

    #19461
    morten
    Participant

    With shortcode – [mappress mapid="438"]

    I’ve corrected the reversed lat/long in the db, but that resulted in the map title “untitled”. I had to delete the title, save, change title back to correct title, then save, before it stuck to correct title. So changing directly in db is definitely last resort.

     

    #19462
    Chris
    Keymaster

    Hi,

    Assuming you use the classic editor, here’s how to change the center:

    1.  Edit the map

    2. Above the list of POIs is a ‘settings’ section.  Expand it and choose ‘automatic’ in the center/zoom section.

    3.  Alternatively, center the map where you’d like it and choose ‘set’ instead.

    4. Save the map

    #19463
    morten
    Participant

    Hi,

    I never change the default, which is Automatic, and is what it is now also. Anyhow – thanks for the input.

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