Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create map-extent, map-input, map-link #887

Merged
merged 147 commits into from
Nov 7, 2023
Merged

Create map-extent, map-input, map-link #887

merged 147 commits into from
Nov 7, 2023

Conversation

prushforth
Copy link
Member

@prushforth prushforth commented Sep 26, 2023

Tests Needed -

  • map-extent checked (when no checked attribute present)
  • map-extent label default and tests
    • if no label and only one map-extent hidden
    • hidden attribute tests for local and remote
    • testing positions when hiding one of the map-extents and re-adding or what not
  • map-extent opacity attribute, check behavior with attribute/container style/ and behavior with how opacity changes through using slider or through API
  • Templated feature going out of bounds, layer is disabled (was a bug on main)
  • layer- hidden attribute test.

extension - Maps4HTML/mapml-extension#66

docs - Maps4HTML/web-map-doc#135

To Do when developing map-link

  • handle query, its bounds, and its ability to be disabled in the layer control
  • Create a new function for map-link that gets the min/max zoom limit based on it's inputs, sample code:
_getMinMaxZoom() {
    let input = this.querySelector('map-input[name=zoom]') || this.querySelector("map-meta[name=zoom]") || this.parentLayer.shadowRoot? this.parentLayer.shadowRoot.querySelector("map-meta[name=zoom]") : this.parentLayer.querySelector("map-meta[name=zoom]");
    if (input) {
     //
    } else {
      // use projection fallback
    }
  }
  • layer not disabled when out of bounds if it has a query

Bugs that still exists
- Debug Mode - When you check and uncheck a layer in debug mode, the layer bounds don't show up when the layer is checked, but do when layer is unchecked. Behaves oppositely.

Bugs discovered on main

To Do Before closing PR

  • bundle all element support js files into mapml.js (b6991c3)

Closes #886

prushfor and others added 4 commits October 6, 2023 17:05
Prevent excessive disconnection / reconnection of layers and map-extents
when clicking on layer control entries, by upping the 'moving' px 
threshold and calculating if the entry has changed position through
the dragging event (do disconnect/reconnect) or not (do not do dis/re).

In map-feature, look for data-moving on layer or map-extent element,
regardless of whether it's a local or remote layer (light dom vs shadow
dom).
Synchronize opacity attribute, property and slider in layer control
(note: works slightly differently than layer.opacity, which doesn't 
"sprout" the opacity attribute when set via layer control)
Fix bug when setting map-extent.hidden in shadow dom of layer element
/layer-._calculateExtent(). To Do: make it efficient / memoize extent
value until extent actually changes.
@AliyanH
Copy link
Member

AliyanH commented Oct 10, 2023

Tests Needed -

  • map-extent checked (when no checked attribute present)
  • map-extent label default and tests
    • if no label and only one map-extent hidden
    • hidden attribute tests for local and remote
    • testing positions when hiding one of the map-extents and re-adding or what not
  • map-extent opacity attribute, check behavior with attribute/container style/ and behavior with how opacity changes through using slider or through API
  • Templated feature going out of bounds, layer is disabled (was a bug on main)
  • layer- hidden attribute test.

extension -

docs -

  • map-extent label "when an extent does not have a label, it is hidden" is no longer true
    • mapml documentation for attributes, ex. checked="checked" is required for the parser
  • Add documentation for hidden attribute for layer to reflect this code for query layers on MapMLLayer.js -> getQueryTemplate:
if (
        this._layerEl.checked &&
        !this._layerEl.hidden &&
        this._mapmlLayerItem
      ) {
  • For our API's we learned that they can only be used after the custom element is attached to the DOM. This needs to be reflected on the web-map-doc. Found using the features API experiment.
  • Document map-change event for layer- element.
  • Document the use of map-meta's inside of map-extents and how they work:

image

To Do when developing map-link

  • handle query, its bounds, and its ability to be disabled in the layer control
  • Create a new function for map-link that gets the min/max zoom limit based on it's inputs, sample code:
_getMinMaxZoom() {
    let input = this.querySelector('map-input[name=zoom]') || this.querySelector("map-meta[name=zoom]") || this.parentLayer.shadowRoot? this.parentLayer.shadowRoot.querySelector("map-meta[name=zoom]") : this.parentLayer.querySelector("map-meta[name=zoom]");
    if (input) {
     //
    } else {
      // use projection fallback
    }
  }
  • layer not disabled when out of bounds if it has a query

Bugs that still exists
- Debug Mode - When you check and uncheck a layer in debug mode, the layer bounds don't show up when the layer is checked, but do when layer is unchecked. Behaves oppositely.

Bugs discovered on main

To Do Before closing PR

  • bundle all element support js files into mapml.js

prushfor and others added 5 commits November 2, 2023 14:45
mapml-viewer.width, .height, .lat, .lon.  Amend tests to enforce this.
…code which was meant to be removed + remove page.pause + remove extra files
…value (if exists) or 1.0 as default; add waitfortimeout and slowmo to fix flaky tests
@prushforth
Copy link
Member Author

Small issue discovered: when you change a remote, hidden, checked map-extent from checked to not checked in the SD (remove the attribute), then remove the hidden attribute to unhide the extent in the layer control, the extent appears checked in the layer control, and changing the checkbox to unchecked now displays the extent. (discovered in geoserver testing).

@AliyanH AliyanH mentioned this pull request Nov 3, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create <map-extent> custom element
3 participants