• Resolved swldwa

    (@swldwa)


    I've just installed your WordPress plugin OS DataHub Maps and been trying it. I'm unable to get marker files to work. The original format marker files work correctly but the JSON format files fail.
    
    The shortcode I'm using is:
    
    [osmap markerfile="https://www.swldwa.uk/wp/wp-content/swldwa/test/marker-test4.txt"]
    
    File marker-test4.txt contains:
    
    [
    { "location": "SH6099054380", "desc": "Snowdon"}
    ]
    
    where the location line is the first line of the example given in your documentation (less the final comma).
    
    When I try to view the map and marker it displays the default page with reported errors:
    
    JQMIGRATE: Migrate is installed, version 3.4.0 jquery-migrate.min.js:2:970
    '[' is not a valid position. It must be either a UK grid reference or two decimal numbers separated by a comma. os-datahub-maps.js:500:25
    {"LOCATION":"SH6099054380" is not a valid coordinate os-datahub-maps.js:483:21
    ']' is not a valid position. It must be either a UK grid reference or two decimal numbers separated by a comma.
    
    I've tried different browsers Firefox, MS Edge, Chrome and they all fail.
    It looks as if it tries to intepret the initial '[' as a position. Also it looks as if something is converting "location" into HTML "location" before your code processes it. I've checked that the file marker-test4.txt has the ASCII values for " and [.
    
    I can't find any relevant settings for th eplugin or WordPress.
    
    I see that the version of WordPress I'm using has not been tested with the plugin but it was failing before I updated it.
    
    I'm stuck - any idea what's going wrong? My apologies if I'm doing something stupid.
    
    Gerry Jackson

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author skirridsystems

    (@skirridsystems)

    Hi Gerry,

    JSON files must have a .json extension, otherwise the plugin doesn’t know which file type to decode. Looks like you’ve found an omission in the documentation! I’ll add that information now.

    Simon

    Thread Starter swldwa

    (@swldwa)

    Thanks for the prompt reply. I thought it should be something simple but I’ve not worked with JSON files before, so my ignorance.

    I’ve amended the file extension and it works. Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Marker file fails to work’ is closed to new replies.