Skip to content

Commit

Permalink
Merge pull request #75 from bcgov/showCoverageOnHover_UI_2
Browse files Browse the repository at this point in the history
Can set showCoverageOnHover for vector layer
  • Loading branch information
michaelpnelson authored Sep 22, 2021
2 parents 1cae31c + 28dac27 commit 0f61eb9
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
25 changes: 16 additions & 9 deletions docs/edit-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ From the WMS Details panel, you can modify the following attributes:

#### Opacity

`Opacity` adjust how transparent the layer is by default. Making a layer 100% Opaque will prevent users from seeing feaures covered by this layer. Setting a layer to 0% Opaque will prevent it from displaying on the map at all, but it will still be identifiable and selectable (just invisible).
`Opacity` adjusts how transparent the layer is by default. Making a layer 100% Opaque will prevent users from seeing feaures covered by this layer. Setting a layer to 0% Opaque will prevent it from displaying on the map at all, but it will still be identifiable and selectable (just invisible).

#### Display Range

Expand All @@ -100,11 +100,11 @@ From the WMS Details panel, you can modify the following attributes:

#### Style Name

`Style Name` Is the name of the WMS Service layer style you are presenting to your users. This should not be modified unless you are certain of a change to source layer styles (confirmed by a review of the WMS Service GetCapabilities). Usually, it's easier to simply re-add the layer.
`Style Name` is the name of the WMS Service layer style you are presenting to your users. This should not be modified unless you are certain of a change to source layer styles (confirmed by a review of the WMS Service GetCapabilities). Usually, it's easier to simply re-add the layer.

#### Metadata URL

`Metadata URL` is A supplied URL for the layers metadata. By default this is empty for WMS layers, but can be supplied if desired. This is useful for providing users with links to data sources or specific external resources related to the data displayed in your application.
`Metadata URL` is a supplied URL for the layer's metadata. By default this is empty for WMS layers, but can be supplied if desired. This is useful for providing users with links to data sources or specific external resources related to the data displayed in your application.

### Vector Layer Details

Expand All @@ -118,6 +118,7 @@ From the Vector Details panel, you can modify the following attributes:
- Display Range
- Data URL
- How should the Data be Displayed?
- Show Cluster Bounds on Hover
- Metadata URL

Note that the Vector Details panel is the same if you've imported vector data directly into your application, or if you're using a URL.
Expand All @@ -132,33 +133,39 @@ Note that the Vector Details panel is the same if you've imported vector data di

#### Opacity

`Opacity` adjust how transparent the layer is by default. Making a layer 100% Opaque will prevent users from seeing feaures covered by this layer. Setting a layer to 0% Opaque will prevent it from displaying on the map at all, but it will still be identifiable and selectable (just invisible).
`Opacity` adjusts how transparent the layer is by default. Making a layer 100% opaque will prevent users from seeing features covered by this layer. Setting a layer to 0% opaque will prevent it from displaying on the map at all, but it will still be identifiable and selectable (just invisible).

#### Display Range

`Display Range` allows you to specify an allowable range where this layer can be displayed. If your map is outside of this scale range, the layer will not draw on the map, and will not be identifiable or selectable.

#### Data URL

`Data URL` Is the URL location for your vector data. If you've imported a vector file into your application, this will be a local path to your applications source folder. Do not modify this URL unless you are sure you want to direct the application to search a specific location for the vector data.
`Data URL` is the URL location for your vector data. If you've imported a vector file into your application, this will be a local path to your application's source folder. Do not modify this URL unless you are sure you want to direct the application to search a specific location for the vector data.

#### How should the Data be Displayed

`How should the Data be Displayed?` Is a styling override for your vector data. This is a dropdown select box that contains three options:
`How should the Data be Displayed?` is a styling override for your vector data. This is a dropdown select box that contains three options:

- Show Feature as Styled (Default)
- Show Features in Clusters
- Show Features as a Heatmap

`Show Feature as Styled` will use the supplied vector styling for the layer. This is the default setting for vector layers.

`Show Features in Clusters` Will still use your default layer styling, but it will show the features clustered on the map, expanding them as you zoom in. This is very useful for dense sets of vector point data.
`Show Features in Clusters` will still use your default layer styling, but it will show the features clustered on the map, expanding them as you zoom in. This is very useful for dense sets of vector point data.

`Show Features as a Heatmap` Will remove your default styling and convert the data into a heatmap display. This is very useful for point data sets.
`Show Features as a Heatmap` will remove your default styling and convert the data into a heatmap display. This is very useful for point data sets.

#### Show Cluster Bounds on Hover

`Show Cluster Bounds on Hover` shows the bounds of a cluster's markers when you mouse over the cluster.

> __Note:__ This option only appears when `Show Features in Clusters` is selected for `How should the Data be Displayed?`.
#### Metadata URL

`Metadata URL` is A supplied URL for the layers metadata. By default this is empty for WMS layers, but can be supplied if desired. This is useful for providing users with links to data sources or specific external resources related to the data displayed in your application.
`Metadata URL` is a supplied URL for the layer's metadata. By default this is empty for WMS layers, but can be supplied if desired. This is useful for providing users with links to data sources or specific external resources related to the data displayed in your application.

### Vector Styling

Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bcgov/smk-cli",
"version": "1.0.1",
"version": "1.0.2",
"description": "A utility for creating and configuring a Simple Map Kit project",
"main": "index.js",
"author": "Ben Jubb <benjubb@gmail.com>",
Expand All @@ -16,7 +16,7 @@
"debug": "./index.js edit --open no --base build/test-app --ping 300000"
},
"dependencies": {
"@bcgov/smk": "^1.0.2",
"@bcgov/smk": ">=1.0.6",
"@tmcw/togeojson": "^4.1.0",
"chalk": "^4.1.0",
"cors": "^2.8.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@
</template>
</input-select>
</div>

<div class="row" v-bind:style="{position:'relative'}">
<input-checkbox v-if="displayMode === 'cluster'" class="col s12"
v-model="showCoverageOnHover"
>Show the bounds of a cluster on hover</input-checkbox>
</div>
</div>
12 changes: 12 additions & 0 deletions smk-edit/static/components/edit-item-details-layer-vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ export default importComponents( [
} )
}
},
showCoverageOnHover: {
get: function () {
var layer = this.$store.getters.configLayer( this.itemId )
return layer.clusterOption && !!layer.clusterOption.showCoverageOnHover
},
set: function ( val ) {
var layer = this.$store.getters.configLayer( this.itemId )
if ( !layer.clusterOption ) layer.clusterOption = {}
layer.clusterOption.showCoverageOnHover = !!val
this.$store.dispatch( 'configLayer', layer )
}
}
},
mounted: function () {
},
Expand Down

0 comments on commit 0f61eb9

Please sign in to comment.