• Resolved Adrian

    (@adriandw)


    Thank you for a very useful start with OS DataHub.
    I’m trying to display multiple boundaries, but I think the plugin only allows a single KML file. I merged the three boundaries into a single kml file but the display does not pick up the polygon border/infill colours defined in the kml file.
    Is that a bug or a restriction?

    What I’m trying to achieve is this (with the OSM OpenStreetMap plugin)
    https://comptonshawford-pc.gov.uk/about/maps/openstreetmap/
    where the display of each kml file layer can be toggled on and off.

    I have an OpenSpace API version at
    https://comptonshawford-pc.gov.uk/ecclesiasticalboundarysg.html
    but I’m struggling to convert it to OS Data Hub mapping (because my OpenLayers skills are a bit weak).

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

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

    (@skirridsystems)

    At the moment it’s a limitation. I added an option to GPX maps to stop overriding any styles set within the GPX file itself, but I didn’t do that for KML. TBH I didn’t even think anyone was using KML and only last night I was wondering about deprecating it. Maybe it needs a stay of execution.

    Toggling layers is not something I’ve had any requests for, and most of the map users are walkers or cyclists, so the main interest is in displaying routes, so I don’t have any plans to add that in the near future.

    I have downloaded your combined KML and I’ll see if it’s possible to prevent the colour override.

    Thread Starter Adrian

    (@adriandw)

    Many thanks for your prompt response.
    I use KML because it supports polygons which I don’t think are possible with a GPX.

    One of the main users of the boundary maps on our parish website is the local school. As a CofE school it’s allowed to use the ecclesiastical parish boundary to define its catchment area, which comes into play over prioritising admissions. Disappointed parents can escalate an appeal, so the school needs to know it’s on firm ground. I don’t believe there’s any other website which makes it as easy to compare the various boundaries as my (OpenSpace) map at https://comptonshawford-pc.gov.uk/about/maps/parish-boundary/

    And talking about walkers, this map https://comptonshawford-pc.gov.uk/TwoRoutes2.html shows two overlapping circular walks in different layers which you can toggle on and off.
    This also has to be converted or sunsetted.

    Thread Starter Adrian

    (@adriandw)

    With the aid of the examples on the OpenSpace migration pages I’ve figured out how to get the OpenLayers layer switcher control working.
    So I’m now confident I can migrate successfully to OS DataHub.

    From the point of view of future maintenance I’d have preferred to drop the bespoke javascript code I developed for the OpenSpace API and use your plugin, because it has many nice features.

    But without layer switching, the option to load multiple gpx/kml files preserving colour settings, I’ll stick with my roll-your-own code for now.

    Plugin Author skirridsystems

    (@skirridsystems)

    Glad you got it working. I’m looking at loading multiple files and layers, but I don’t have an ETA yet.

    I take your point about this use case for KML. Unfortunately KML is a complex format and Leaflet is not able to use the embedded colours. However, if I can get multiple KMLs to load then each one can have its own colour, which should achieve what you want.

    Plugin Author skirridsystems

    (@skirridsystems)

    Update: I’ve got multiple KML files loading with different colours using a raw HTML test.

    I need to translate that into the plugin and add the mechanism for enabling layers. The layers thing does exist in Leaflet, but I’ve not used it before.

    Thread Starter Adrian

    (@adriandw)

    Thanks for the update.
    My (not yet final) version using OpenLayers is at
    https://comptonshawford-pc.gov.uk/WorkInProgress.html
    As I can create polygons, I can use co-ordinate pairs and don’t need to imbed KML.
    I will probably imbed it in WordPress using an iframe.
    If you put raw html in a WordPress page, there’s always the chance that the WordPress editor will mangle it.

    From my point of view, if you enable layers, it will make the plugin hugely more useful.

    I was wondering whether to switch to Leaflet, but OpenLayers seemed the easiest route starting from the OpenSpace API.

    Plugin Author skirridsystems

    (@skirridsystems)

    Yes, the raw HTML was only for my initial testing purposes so I can see what’s working. It means I can separate the JS problems from the PHP problems and try things out in a minimalist framework first. Now that I know it works I can work out how to add it to the plugin.

    I noticed that all the examples in the OpenSpace migration were for OpenLayers so that’s the path of least resistance for your immediate needs. I’m not sure when the final switch-off date is for OpenSpace but it’s sometime in August unless it’s been pushed back, so anywhere from 1 to 30 days away.

    Plugin Author skirridsystems

    (@skirridsystems)

    I have an updated version of the plugin in test which now supports multiple KML files and layers. If you contact me by email (address is on my website) then I can send a copy to you for testing.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘KML support’ is closed to new replies.