Skip to content

Commit

Permalink
WIP on map-link
Browse files Browse the repository at this point in the history
- initial commit for prefers-map-content support for image, tiled-image,
vector-tile,feature,table,no-preference
  • Loading branch information
prushforth committed Mar 23, 2024
1 parent f28f014 commit 1e8fd7b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ chrome.runtime.onInstalled.addListener(async () => {
featureIndexOverlayOption: false,
renderMap: true,
defaultExtCoor: 'pcrs',
defaultLocCoor: 'gcrs'
defaultLocCoor: 'gcrs',
defaultContentPreference: 'no-preference'
}
});
registerContentScripts();
Expand Down
16 changes: 16 additions & 0 deletions src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ <h6 class="card-title">Accessibility Settings</h6>

</div>
</div>
<div class="card">
<div class="card-body">
<h6 class="card-title">Content Preferences</h6>
<div>
<label class="form-label" for="content-prefs">Preferred map content type: </label>
<select class="form-select form-select-sm" id="contentPreference">
<option value="no-preference" selected>No preference (default)</option>
<option value="image">Images</option>
<option value="tiled-image">Tiled images</option>
<option value="feature">Features</option>
<option value="vector-tile">Vector tiles</option>
<option value="table">Tables</option>
</select>
</div>
</div>
</div>


</div>
Expand Down
4 changes: 3 additions & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function loadOptions() {
featureIndexOverlayOption: false,
renderMap: false,
defaultExtCoor: 'pcrs',
defaultLocCoor: 'gcrs'
defaultLocCoor: 'gcrs',
defaultContentPreference: 'no-preference'
};
for (let name in options) {
let elem = document.getElementById(name);
Expand Down Expand Up @@ -71,5 +72,6 @@ document.addEventListener("DOMContentLoaded", () => {
document.getElementById("renderMap").addEventListener("change", handleCheckboxChange);
document.getElementById("defaultExtCoor").addEventListener("change", handleDropdownChange);
document.getElementById("defaultLocCoor").addEventListener("change", handleDropdownChange);
document.getElementById('contentPreference').addEventListener("change", handleDropdownChange);
});

0 comments on commit 1e8fd7b

Please sign in to comment.