martindholmes / BreezeMap

BreezeMap is a project to create a simple user interface for interactive map and facsimile editing based on TEI XML and OpenLayers 4+.
MIT License
11 stars 3 forks source link

More control over taxonomy selector #49

Closed martindholmes closed 2 years ago

martindholmes commented 2 years ago

@gtnewton correctly suggests that it should be possible to specify that a given taxonomy (including the "all" taxonomy) be the default one, rather than relying on the order of taxonomies. This can be done after load using JS:

let s = document.querySelector('span.taxonomySelector');
s.children[0].selectedIndex = s.children[0].options.length - 1; 
holLayer.changeTaxonomy(s.children[0]);

but it would be better to:

  1. Give the actual selector an id (but this is incidental).
  2. Provide an alternative way to run changeTaxonomies which is a method of hol.VectorLayer and takes a taxonomy id as input.
  3. Provide a way for the XML or the options to specify an initial taxonomy by id (with the "all" taxonomy having a designated id).
  4. During initialization, act on the option if it's present.
martindholmes commented 2 years ago

Working on this in branch issue-49-taxonomy.

martindholmes commented 2 years ago

Completed as of commit 12738d4.