Skip to content

Commit

Permalink
removed .cfg as a requirement for shapefiles, visualization supports …
Browse files Browse the repository at this point in the history
…point and line shapefiles
  • Loading branch information
wscullen committed Sep 15, 2020
1 parent cd37772 commit 4ce93f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tile-viewer",
"version": "v0.3.0",
"version": "v0.3.1",
"description": "Allow easy selection of optical satellite imagery, integration with batch downloader and atmospheric correction.",
"license": "MIT",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddAreaOfInterestModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const END_DATE = 'endDate'

type START_OR_END_DATE = 'startDate' | 'endDate'

const SUPPORTED_FORMATS = ['.shp', '.shx', '.cpg', '.prj', '.dbf']
const SUPPORTED_FORMATS = ['.shp', '.shx', '.prj', '.dbf']

declare var VERSION: string

Expand Down
21 changes: 16 additions & 5 deletions src/components/MapViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { platformModifierKeyOnly } from 'ol/events/condition'
//@ts-ignore
import LayerSwitcher from 'ol-layerswitcher'

import { Fill, Stroke, Style, Text } from 'ol/style'
import { Fill, Stroke, Style, Text, Circle } from 'ol/style'

import moment from 'moment'

Expand Down Expand Up @@ -422,13 +422,24 @@ export default class MapViewer extends Component<AppProps, AppState> {
return wrsOverlayStyle
}

function getOverlayStyleForVisualization(feature: Feature) {
function getOverlayStyleForVisualization(feature: Feature, resolution: Number) {
console.log(resolution)
console.log('SETTING STYLE FOR VISUALIZATION')
console.log(feature.getProperties())
const wrsOverlayStyle = new Style({
image: new Circle({
fill: new Fill({
color: 'rgba(215, 3, 250, 0.8)',
}),
stroke: new Stroke({
color: 'rgba(215, 3, 250, 0.8)',
width: 1,
}),
radius: resolution < 80.0 ? 6 : 3
}),
stroke: new Stroke({
color: 'rgba(235, 240, 25, 0.8)',
width: 3,
color: 'rgba(215, 3, 250, 0.8)',
width: 2,
}),
fill: new Fill({
color: 'rgba(0,0,0,0)',
Expand All @@ -442,7 +453,7 @@ export default class MapViewer extends Component<AppProps, AppState> {
color: '#fff',
width: 2,
}),
text: feature.get('name'),
text: resolution < 80.0 ? feature.get('name') : null,
}),
})
return wrsOverlayStyle
Expand Down

0 comments on commit 4ce93f2

Please sign in to comment.