Compare commits

..

No commits in common. "9c143649a2819d0ae2501b08067e303b9d0e70d0" and "988ec5036827bb3561a33fd29eb8978f4fc79387" have entirely different histories.

6 changed files with 22 additions and 12 deletions

View File

@ -116,10 +116,10 @@
geojsonLayer = L.geoJSON(geojson, { geojsonLayer = L.geoJSON(geojson, {
style: feature => { style: feature => {
return { return {
color: feature.properties.landxmlColor, color: feature.properties.color,
fillColor: feature.properties.landxmlColor, fillColor: feature.properties.fill,
fillOpacity: 0.5, fillOpacity: feature.properties['fill-opacity'],
weight: 1, weight: feature.properties['stroke-width'],
} }
}, },
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({
'fillOpacity': 0.9 'fillColor': 'blue'
}) })
} }

View File

@ -32,7 +32,10 @@ export function convertCGPoints(xmlObj, projection, opts) {
name: name, name: name,
description: description, description: description,
landxmlType: LANDXML_POINT, landxmlType: LANDXML_POINT,
landxmlColor: getColor(`point-${name}`, opts.colorOpts), "stroke-width": 0,
"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);

View File

@ -48,7 +48,7 @@ export class Converter {
], ],
featureMapper: (feature, opts) => feature, featureMapper: (feature, opts) => feature,
colorOpts: { colorOpts: {
hue: 'blue', hue: 'monochrome',
luminosity: 'dark', luminosity: 'dark',
seed: 1, seed: 1,
}, },

View File

@ -1,4 +1,4 @@
import { getProp, parseSequence, getColor } from './util' import { getProp, parseSequence } from './util'
import { polygon } from '@turf/helpers'; import { polygon } from '@turf/helpers';
import proj4 from 'proj4'; import proj4 from 'proj4';
@ -63,7 +63,6 @@ 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 {

View File

@ -28,6 +28,8 @@ 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);
@ -39,10 +41,13 @@ 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);
@ -73,7 +78,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,
landxmlColor: getColor(`pipe-network-pipe-${name}`, opts.colorOpts) stroke: getColor(`pipe-network-pipe-${name}`, opts.colorOpts)
}); });
if (circPipeNode !== undefined) { if (circPipeNode !== undefined) {
@ -133,7 +138,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,
landxmlColor: getColor(`pipe-network-struct-${name}`, opts.colorOpts) fill: getColor(`pipe-network-struct-${name}`, opts.colorOpts)
}); });
if (circStructNode !== undefined) { if (circStructNode !== undefined) {

View File

@ -33,7 +33,10 @@ export function convertSurfaces(xmlObj, projection, opts) {
name: name, name: name,
description: description, description: description,
landxmlType: LANDXML_SURFACE, landxmlType: LANDXML_SURFACE,
landxmlColor: getColor(`surface-${name}`, opts.colorOpts), "stroke-width": 0,
"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);