Open dhlevi opened 6 years ago
One way to handle this:
When parsing the KML file, if there are multiple styles defined, then create an output geojson for each style. Each feature from the KML goes into exactly one output file.
Now the user is given 3 options:
A layer folder contains 1 or more layers. The folder has a visibility flag that controls all the child layers. Each child layer also has a visibility flag. In the layers panel, the child layers are visible under the parent.
A layer group, is like a layer folder except that the child layers are not exposed to the user. The layer group appears in the layer list as a single layer, and it's internal structure is not exposed. The parent has a visibility flag that controls the child layers.
So, if a KML file with multiple styles is loaded, a layer group can be constructed that contains a vector layer for each style, but behaves in the client like a single layer.
Another related idea:
Some geodata formats, shapefiles and geojson for example, can be hetrogeneous. Each feature in these files can have a different geometry type (point, line, polygon). It may be desirable to style each type of geometry differently. The approach described above would allow this, if the input file was partitioned into multiple output files by geometry type.
Looks good!
Handler added to Admin UI to split KML files with multiple styles into seperate layers. This will also trigger when replacing data from a layer, by matching generated ID's and updating their attachments. In the event you've changed an ID or renamed a style in the source KML, it will generate new layers.
Note, code is in place on the service to handle the same behaviours for KMZ uploads, but a handler is yet to be completely implemented on the Admin UI. This will be coming shortly.
Code complete in client to allow layers to organized into folders & groups. This is done with configuration on the layers tool. Docs: https://github.com/bcgov/smk/wiki/SMK-Client-Configuration#layers-tool
KMZ upload handling for url icons has been added
SMK currently only loads a single kml icon style for the whole uploaded layer. Decide on handling for this scenario in SMK to either allow a layer to have multiple marker styles, or to split the data into multiple layers.
See the BC Parks KML for an example of this behaviour.