-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from wearepal/shapes-as-extent
Users can choose from predefined extents with a shape mask
- Loading branch information
Showing
35 changed files
with
550 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the masks controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: https://sass-lang.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class MasksController < ApplicationController | ||
|
||
def create | ||
authorize! | ||
@mask = Mask.new(:name => params[:name], :file => params[:file]) | ||
if @mask.save | ||
render json: @mask, status: :created | ||
else | ||
render json: @mask.errors, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def show | ||
authorize! | ||
@mask = Mask.find_by(:name => params[:name]) | ||
redirect_to @mask.file | ||
end | ||
|
||
def index | ||
authorize! | ||
@masks = Mask.all | ||
render json: @masks | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module MasksHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,11 @@ export interface ModelViewProps { | |
getDatasets: getDatasets | ||
extent: Extent | ||
zoom: number | ||
mask: boolean | ||
maskLayer: string | ||
maskCQL: string | ||
} | ||
export function ModelView({ visible, initialTransform, setTransform, initialModel, setModel, createOutputLayer, deleteOutputLayer, saveMapLayer, setProcessing, autoProcessing, process, setProcess, saveModel, getDatasets, extent, zoom }: ModelViewProps) { | ||
export function ModelView({ visible, initialTransform, setTransform, initialModel, setModel, createOutputLayer, deleteOutputLayer, saveMapLayer, setProcessing, autoProcessing, process, setProcess, saveModel, getDatasets, extent, zoom, mask, maskLayer, maskCQL }: ModelViewProps) { | ||
const ref = React.useRef<HTMLDivElement>(null) | ||
const [editor, setEditor] = React.useState<NodeEditor>() | ||
const [engine, setEngine] = React.useState<Engine>() | ||
|
@@ -65,7 +68,7 @@ export function ModelView({ visible, initialTransform, setTransform, initialMode | |
}) | ||
|
||
const engine = new Engine("[email protected]") | ||
createDefaultComponents(saveMapLayer, saveModel, getDatasets, extent, zoom).forEach(component => { | ||
createDefaultComponents(saveMapLayer, saveModel, getDatasets, extent, zoom, mask, maskLayer, maskCQL).forEach(component => { | ||
editor.register(component) | ||
engine.register(component) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.