Compare commits
2 Commits
988ec50368
...
9c143649a2
Author | SHA1 | Date | |
---|---|---|---|
9c143649a2 | |||
f60a97b8f8 |
@ -116,10 +116,10 @@
|
|||||||
geojsonLayer = L.geoJSON(geojson, {
|
geojsonLayer = L.geoJSON(geojson, {
|
||||||
style: feature => {
|
style: feature => {
|
||||||
return {
|
return {
|
||||||
color: feature.properties.color,
|
color: feature.properties.landxmlColor,
|
||||||
fillColor: feature.properties.fill,
|
fillColor: feature.properties.landxmlColor,
|
||||||
fillOpacity: feature.properties['fill-opacity'],
|
fillOpacity: 0.5,
|
||||||
weight: feature.properties['stroke-width'],
|
weight: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onEachFeature: (f, l) => {
|
onEachFeature: (f, l) => {
|
||||||
@ -141,7 +141,7 @@
|
|||||||
if(feature.geometry.type !== 'Point') {
|
if(feature.geometry.type !== 'Point') {
|
||||||
// Style selected
|
// Style selected
|
||||||
selectedFeature.setStyle({
|
selectedFeature.setStyle({
|
||||||
'fillColor': 'blue'
|
'fillOpacity': 0.9
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,10 +32,7 @@ export function convertCGPoints(xmlObj, projection, opts) {
|
|||||||
name: name,
|
name: name,
|
||||||
description: description,
|
description: description,
|
||||||
landxmlType: LANDXML_POINT,
|
landxmlType: LANDXML_POINT,
|
||||||
"stroke-width": 0,
|
landxmlColor: getColor(`point-${name}`, opts.colorOpts),
|
||||||
"color": "transparent",
|
|
||||||
"fill": getColor(`point-${name}`, opts.colorOpts),
|
|
||||||
"fill-opacity": 0.3,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const pointFeature = convertPoint(p, projection, featureProps, opts);
|
const pointFeature = convertPoint(p, projection, featureProps, opts);
|
||||||
|
@ -48,7 +48,7 @@ export class Converter {
|
|||||||
],
|
],
|
||||||
featureMapper: (feature, opts) => feature,
|
featureMapper: (feature, opts) => feature,
|
||||||
colorOpts: {
|
colorOpts: {
|
||||||
hue: 'monochrome',
|
hue: 'blue',
|
||||||
luminosity: 'dark',
|
luminosity: 'dark',
|
||||||
seed: 1,
|
seed: 1,
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { getProp, parseSequence } from './util'
|
import { getProp, parseSequence, getColor } from './util'
|
||||||
import { polygon } from '@turf/helpers';
|
import { polygon } from '@turf/helpers';
|
||||||
import proj4 from 'proj4';
|
import proj4 from 'proj4';
|
||||||
|
|
||||||
@ -63,6 +63,7 @@ export function convertParcels(xmlObj, projection, opts) {
|
|||||||
landxmlState: opc.$.state,
|
landxmlState: opc.$.state,
|
||||||
landxmlParcelType: opc.$.parcelType,
|
landxmlParcelType: opc.$.parcelType,
|
||||||
landxmlType: LANDXML_PARCEL,
|
landxmlType: LANDXML_PARCEL,
|
||||||
|
landxmlColor: getColor(`parcel-${name}`, opts.colorOpts),
|
||||||
}
|
}
|
||||||
polygons.push(polygon(coords, parameters))
|
polygons.push(polygon(coords, parameters))
|
||||||
} else {
|
} else {
|
||||||
|
@ -28,8 +28,6 @@ export function convertPipeNetworks(xmlObj, projection, opts) {
|
|||||||
const baseProps = {
|
const baseProps = {
|
||||||
name: pn.$.name,
|
name: pn.$.name,
|
||||||
description: pn.$.desc,
|
description: pn.$.desc,
|
||||||
"stroke-width": 0.1,
|
|
||||||
"fill-opacity": 0.5,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const localStructs = convertStructs(pn, projection, baseProps, opts);
|
const localStructs = convertStructs(pn, projection, baseProps, opts);
|
||||||
@ -41,13 +39,10 @@ export function convertPipeNetworks(xmlObj, projection, opts) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
pipeNetworkNodes.forEach(pn => {
|
pipeNetworkNodes.forEach(pn => {
|
||||||
|
|
||||||
const baseProps = {
|
const baseProps = {
|
||||||
name: pn.$.name,
|
name: pn.$.name,
|
||||||
description: pn.$.desc,
|
description: pn.$.desc,
|
||||||
landxmlType: LANDXML_PIPE_NETWORK_PIPE,
|
landxmlType: LANDXML_PIPE_NETWORK_PIPE,
|
||||||
"stroke-width": 1,
|
|
||||||
"fill-opacity": 1,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const pipes = convertPipes(pn, structs, projection, baseProps, opts);
|
const pipes = convertPipes(pn, structs, projection, baseProps, opts);
|
||||||
@ -78,7 +73,7 @@ function convertPipes(pipeNetwork, structs, projection, baseProps, opts) {
|
|||||||
const featureProps = Object.assign({}, baseProps, {
|
const featureProps = Object.assign({}, baseProps, {
|
||||||
name: name,
|
name: name,
|
||||||
description: baseProps.description ? baseProps.description + ' - ' + p.$.desc : p.$.desc,
|
description: baseProps.description ? baseProps.description + ' - ' + p.$.desc : p.$.desc,
|
||||||
stroke: getColor(`pipe-network-pipe-${name}`, opts.colorOpts)
|
landxmlColor: getColor(`pipe-network-pipe-${name}`, opts.colorOpts)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (circPipeNode !== undefined) {
|
if (circPipeNode !== undefined) {
|
||||||
@ -138,7 +133,7 @@ function convertStructs(pipeNetwork, projection, baseProps, opts) {
|
|||||||
landxmlStruct: structType,
|
landxmlStruct: structType,
|
||||||
landxmlElevRim: 'elevRim' in s.$ ? parseFloat(s.$.elevRim) : undefined,
|
landxmlElevRim: 'elevRim' in s.$ ? parseFloat(s.$.elevRim) : undefined,
|
||||||
landxmlElevSump: 'elevSump' in s.$ ? parseFloat(s.$.elevSump) : undefined,
|
landxmlElevSump: 'elevSump' in s.$ ? parseFloat(s.$.elevSump) : undefined,
|
||||||
fill: getColor(`pipe-network-struct-${name}`, opts.colorOpts)
|
landxmlColor: getColor(`pipe-network-struct-${name}`, opts.colorOpts)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (circStructNode !== undefined) {
|
if (circStructNode !== undefined) {
|
||||||
|
@ -33,10 +33,7 @@ export function convertSurfaces(xmlObj, projection, opts) {
|
|||||||
name: name,
|
name: name,
|
||||||
description: description,
|
description: description,
|
||||||
landxmlType: LANDXML_SURFACE,
|
landxmlType: LANDXML_SURFACE,
|
||||||
"stroke-width": 0,
|
landxmlColor: getColor(`surface-${name}`, opts.colorOpts),
|
||||||
"color": "transparent",
|
|
||||||
"fill": getColor(`surface-${name}`, opts.colorOpts),
|
|
||||||
"fill-opacity": 0.3,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let surfaceFeatures = convertBoundaries(s, projection, featureProps, opts);
|
let surfaceFeatures = convertBoundaries(s, projection, featureProps, opts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user