Skip to content

Commit

Permalink
blankstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
lbutler committed Sep 10, 2019
1 parent 6578370 commit 0bc4c50
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 11 deletions.
14 changes: 11 additions & 3 deletions src/components/VectorMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ReactMapGL, {
import { fromJS } from "immutable";
import {
OsZoomStackLight,
BlankMap,
MapboxStyle,
HydrantStyle,
MainStyle,
Expand Down Expand Up @@ -101,9 +102,13 @@ class VectorMap extends Component<VectorMapProps, VectorMapState> {
]);
const wn_meter = extractAssetType(geoJson, ["wn_meter"]);
const wn_valve = extractAssetType(geoJson, ["wn_valve"]);

// TODO: Clean up!!
const usingOsBaseMap = this.props.projectionString === britishNationalGrid;
const baseStyle = usingOsBaseMap ? OsZoomStackLight : MapboxStyle;
const baseStyle = usingOsBaseMap
? OsZoomStackLight
: this.props.projectionString === "METERS"
? BlankMap
: MapboxStyle;
const immutBase = fromJS(baseStyle); //)
const mapStyle = immutBase
.setIn(
Expand Down Expand Up @@ -183,12 +188,15 @@ class VectorMap extends Component<VectorMapProps, VectorMapState> {
padding: 20
});

const transitionDuration =
this.props.projectionString === "METERS" ? 0 : 50000;

const viewport = {
...this.state.viewport,
longitude,
latitude,
zoom,
transitionDuration: 7000,
transitionDuration,
transitionInterpolator: new FlyToInterpolator(),
transitionEasing: easeCubic
};
Expand Down
35 changes: 35 additions & 0 deletions src/mapstyles/base/blank.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": 8,
"name": "Blank",
"metadata": {
"mapbox:autocomposite": true,
"mapbox:type": "template",
"mapbox:sdk-support": {
"js": "0.50.0",
"android": "6.7.0",
"ios": "4.6.0"
}
},
"center": [
-1.464858786792547,
50.939150779110975
],
"zoom": 13.12365211904204,
"bearing": -0.44200633613297663,
"pitch": 0,
"light": {
"intensity": 0.25,
"color": "hsl(0, 0%, 100%)"
},
"sprite": "mapbox://sprites/mapbox/basic-v8",
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "#e6e5e1"
}
}
]
}
17 changes: 9 additions & 8 deletions src/mapstyles/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import OsZoomStackLight from './base/open-zoom-stack-light.json';
import MapboxStyle from './base/style.json';
import HydrantStyle from './water/hydrant';
import MainStyle from './water/main';
import MeterStyle from './water/meter';
import ValveStyle from './water/valve';
import OsZoomStackLight from "./base/open-zoom-stack-light.json";
import MapboxStyle from "./base/style.json";
import BlankMap from "./base/blank.json";
import HydrantStyle from "./water/hydrant";
import MainStyle from "./water/main";
import MeterStyle from "./water/meter";
import ValveStyle from "./water/valve";

export {
BlankMap,
OsZoomStackLight,
HydrantStyle,
MainStyle,
MeterStyle,
ValveStyle,
MapboxStyle
}

};

0 comments on commit 0bc4c50

Please sign in to comment.