{"version":3,"sources":["directions.js","map.js","App.js","reportWebVitals.js","index.js"],"names":["VALID_POSITIONS","Directions","directions","initializeDirections","mapboxMap","getMapboxMap","props","mapboxApiAccessToken","position","styles","api","interactive","profile","alternatives","congestion","unit","compile","geocoder","controls","zoom","placeholderOrigin","placeholderDestination","flyTo","exclude","onInit","options","accessToken","MapboxDirections","subscribeEvents","addControl","find","_position","mapRef","current","getMap","on","handleClear","handleLoading","handleProfile","handleOrigin","handleDestination","handleRoute","handleError","unsubscribeEvents","off","removeDirections","removeControl","event","onClear","onLoading","onProfile","onOrigin","onDestination","onRoute","onError","this","PureComponent","defaultProps","mapboxgl","workerClass","require","default","MAPBOX_ACCESS_TOKEN","Map","COLOR_SCALE","scaleThreshold","domain","range","App","map","maplibregl","container","style","center","ambientLight","MapboxGeocoder","marker","AmbientLight","color","intensity","dirLight","SunLight","timestamp","Date","UTC","_shadow","lightingEffect","LightingEffect","shadowColor","GeolocateControl","positionOptions","enableHighAccuracy","trackUserLocation","NavigationControl","ScatterplotLayer","id","data","radiusScale","radiusMinPixels","getPosition","d","getFillColor","parameters","depthMask","depthTest","blendFunc","GL","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","ONE","blendEquation","FUNC_ADD","TerrainLayer","elevationDecoder","rScaler","gScaler","bScaler","offset","elevationData","texture","bounds","PolygonLayer","stroked","getPolygon","f","geoJSONLayer","GeoJsonLayer","opacity","filled","extruded","wireframe","getElevation","Math","sqrt","properties","valuePerSqm","growth","getLineColor","pickable","deck","ArcLayer","type","source","target","getSourcePosition","getTargetPosition","getSourceColor","getTargetColor","getWidth","ContourLayer","contours","threshold","strokeWidth","PointCloudLayer","coordinateSystem","COORDINATE_SYSTEM","METER_OFFSETS","coordinateOrigin","Deck","gl","painter","context","layers","effects","initialViewState","latitude","longitude","controller","deckLayers","MapboxLayer","addLayer","ref","el","mapWrapper","className","React","Component","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","document","get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GAClBA,GAAeA,aAAuBC,UACxC,8BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCEdQ,IAASC,OAEL,cAAC,EAAD,IACFC,SAASC,eAAe,SAM1BZ,M","file":"static/js/main.d4e66436.chunk.js","sourcesContent":["import { PureComponent } from 'react'\nimport PropTypes from 'prop-types'\nimport MapboxDirections from '@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions'\nimport '@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions.css'\n\n\n\n\nconst VALID_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right']\n\nclass Directions extends PureComponent {\n directions = null\n\n componentDidMount() {\n this.initializeDirections()\n }\n componentWillUnmount() {\n this.removeDirections()\n }\n\n componentDidUpdate() {\n this.removeDirections()\n this.initializeDirections()\n }\n\n initializeDirections = () => {\n const mapboxMap = this.getMapboxMap()\n const {\n mapboxApiAccessToken,\n position,\n styles,\n api,\n interactive,\n profile,\n alternatives,\n congestion,\n unit,\n compile,\n geocoder,\n controls,\n zoom,\n placeholderOrigin,\n placeholderDestination,\n flyTo,\n exclude,\n onInit,\n } = this.props\n\n const options = {\n accessToken: mapboxApiAccessToken,\n styles,\n api,\n interactive,\n profile,\n alternatives,\n congestion,\n unit,\n geocoder,\n controls,\n zoom,\n placeholderOrigin,\n placeholderDestination,\n flyTo,\n exclude,\n }\n\n if (compile && typeof compile === 'function') {\n options.compile = compile\n }\n\n this.directions = new MapboxDirections(options)\n this.subscribeEvents()\n\n mapboxMap.addControl(\n this.directions,\n VALID_POSITIONS.find((_position) => position === _position)\n )\n\n onInit(this.directions)\n }\n\n getMapboxMap = () => {\n const { mapRef } = this.props\n return (mapRef && mapRef.current && mapRef.current.getMap()) || null\n }\n\n subscribeEvents = () => {\n this.directions.on('clear', this.handleClear)\n this.directions.on('loading', this.handleLoading)\n this.directions.on('profile', this.handleProfile)\n this.directions.on('origin', this.handleOrigin)\n this.directions.on('destination', this.handleDestination)\n this.directions.on('route', this.handleRoute)\n this.directions.on('error', this.handleError)\n }\n unsubscribeEvents = () => {\n this.directions.off('clear', this.handleClear)\n this.directions.off('loading', this.handleLoading)\n this.directions.off('profile', this.handleProfile)\n this.directions.off('origin', this.handleOrigin)\n this.directions.off('destination', this.handleDestination)\n this.directions.off('route', this.handleRoute)\n this.directions.off('error', this.handleError)\n }\n\n removeDirections = () => {\n const mapboxMap = this.getMapboxMap()\n\n this.unsubscribeEvents()\n if (mapboxMap && mapboxMap.removeControl) {\n this.getMapboxMap().removeControl(this.directions)\n }\n\n this.directions = null\n }\n\n handleClear = (event) => {\n this.props.onClear(event)\n }\n handleLoading = (event) => {\n this.props.onLoading(event)\n }\n handleProfile = (event) => {\n this.props.onProfile(event)\n }\n handleOrigin = (event) => {\n this.props.onOrigin(event)\n }\n handleDestination = (event) => {\n this.props.onDestination(event)\n }\n handleRoute = (event) => {\n this.props.onRoute(event)\n }\n handleError = (event) => {\n this.props.onError(event)\n }\n\n render() {\n return null\n }\n\n static propTypes = {\n mapRef: PropTypes.object.isRequired,\n mapboxApiAccessToken: PropTypes.string.isRequired,\n position: PropTypes.oneOf(VALID_POSITIONS),\n styles: PropTypes.array,\n api: PropTypes.string,\n interactive: PropTypes.bool,\n profile: PropTypes.string,\n alternatives: PropTypes.bool,\n congestion: PropTypes.bool,\n unit: PropTypes.string,\n compile: PropTypes.func,\n geocoder: PropTypes.object,\n controls: PropTypes.object,\n zoom: PropTypes.number,\n placeholderOrigin: PropTypes.string,\n placeholderDestination: PropTypes.string,\n flyTo: PropTypes.bool,\n exclude: PropTypes.bool,\n onInit: PropTypes.func,\n onClear: PropTypes.func,\n onLoading: PropTypes.func,\n onOrigin: PropTypes.func,\n onProfile: PropTypes.func,\n onDestination: PropTypes.func,\n onRoute: PropTypes.func,\n onError: PropTypes.func,\n }\n\n static defaultProps = {\n position: 'bottom-left',\n zoom: 16,\n api: 'https://api.mapbox.com/directions/v5/',\n profile: 'mapbox/driving-traffic',\n onInit: () => {},\n onClear: () => {},\n onLoading: () => {},\n onOrigin: () => {},\n onProfile: () => {},\n onDestination: () => {},\n onRoute: () => {},\n onError: () => {},\n }\n}\nexport default Directions","\nimport {StaticMap,NavigationControl,GeolocateControl} from 'react-map-gl';\nimport React, {useState,useRef, useCallback} from 'react';\nimport Geocoder from 'react-map-gl-geocoder';\nimport MapGL from \"react-map-gl\";\nimport Directions from './directions'\nimport mapboxgl from 'mapbox-gl';\n// @ts-ignore\n// eslint-disable-next-line import/no-webpack-loader-syntax\nmapboxgl.workerClass = require('worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker').default;\n\n\n// Set your mapbox access token here\nconst MAPBOX_ACCESS_TOKEN = 'pk.eyJ1Ijoid2ViY29kZXJ6IiwiYSI6ImNrcjZ1N3oxeDB0cHoyd3FsYjk0am9kY3MifQ.lw9n5DtqV-PjMyL4k6jwQA';\nmapboxgl.accessToken= MAPBOX_ACCESS_TOKEN\n\n\n\nconst NAV_CONTROL_STYLE = {\n position: 'fixed',\n bottom: 30,\n right :10\n};\n\n\n\n\nfunction GeoLocate() {\n const geolocateControlStyle= {\n position: 'fixed',\n right: 10,\n bottom: 118\n };\n return (\n \n \n );\n}\n\n\n\nfunction Map() {\n const [viewport, setViewport] = useState({\n latitude: 37.7577,\n longitude: -122.4376,\n zoom: 8\n });\n const mapRef = useRef();\n const handleViewportChange = useCallback(\n (newViewport) => setViewport(newViewport),\n []\n );\n\n // if you are happy with Geocoder default settings, you can just use handleViewportChange directly\n const handleGeocoderViewportChange = useCallback(\n (newViewport) => {\n const geocoderDefaultOverrides = { transitionDuration: 1000 };\n\n return handleViewportChange({\n ...newViewport,\n ...geocoderDefaultOverrides\n });\n },\n [handleViewportChange]\n );\n\n return (\n
\n\n \n \n \n \n \n \n
\n );\n};\n\n\n\n\n\n\n\nexport default Map\n\n\n\n\n","import React from 'react';\nimport './App.css';\nimport mapboxgl from 'mapbox-gl';\nimport 'mapbox-gl/dist/mapbox-gl.css';\nimport MapboxDirections from '@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions'\nimport MapboxGeocoder from '@mapbox/mapbox-gl-geocoder';\nimport MapboxTraffic from '@mapbox/mapbox-gl-traffic';\nimport '@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder.css';\nimport { ArcLayer,ContourLayer} from 'deck.gl';\nimport {COORDINATE_SYSTEM} from '@deck.gl/core';\nimport { Deck } from \"@deck.gl/core\";\nimport GL from '@luma.gl/constants';\nimport maplibregl from 'maplibre-gl';\n\nimport { ScatterplotLayer} from \"@deck.gl/layers\";\nimport { MapboxLayer } from \"@deck.gl/mapbox\";\nimport {TerrainLayer} from '@deck.gl/geo-layers';\nimport {PointCloudLayer} from '@deck.gl/layers';\n\nimport {GeoJsonLayer, PolygonLayer} from '@deck.gl/layers';\nimport {LightingEffect, AmbientLight, _SunLight as SunLight} from '@deck.gl/core';\nimport {scaleThreshold} from 'd3-scale';\n\n\n\nmapboxgl.accessToken = 'pk.eyJ1Ijoid2ViY29kZXJ6IiwiYSI6ImNrcjZ1N3oxeDB0cHoyd3FsYjk0am9kY3MifQ.lw9n5DtqV-PjMyL4k6jwQA';\n\n\n\n\n // eslint-disable-line\n\n\nexport const COLOR_SCALE = scaleThreshold()\n .domain([-0.6, -0.45, -0.3, -0.15, 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05, 1.2])\n .range([\n [65, 182, 196],\n [127, 205, 187],\n [199, 233, 180],\n [237, 248, 177],\n // zero\n [255, 255, 204],\n [255, 237, 160],\n [254, 217, 118],\n [254, 178, 76],\n [253, 141, 60],\n [252, 78, 42],\n [227, 26, 28],\n [189, 0, 38],\n [128, 0, 38]\n ]);\n\n\nclass App extends React.Component {\n\n componentDidMount() {\n \n\n // Creates new map instance\n const map = new maplibregl.Map({\n container: 'map',\n style: 'https://api.maptiler.com/maps/streets/style.json?key=Z2xVIwqvxK06NnhO6lTM', // stylesheet location - https://api.maptiler.com/maps/streets/style.json?key=Z2xVIwqvxK06NnhO6lTM\n center: [-122.5233, 37.6493], // starting position [lng, lat]\n zoom: 9 // starting zoom\n });\n //https://api.maptiler.com/maps/eec8273f-d9d8-4d03-883a-cb9c35cc27d8/style.json?key=Z2xVIwqvxK06NnhO6lTM\n //http://64.227.67.107:8080/styles/basic-preview/style.json for self hosted\n //http://64.227.67.107/styles/osm-bright/style.json\n //http://mapserver.webi.ai/styles/osm-bright/style.json\n \n // Creates new directions control instance\n const directions = new MapboxDirections({\n accessToken: mapboxgl.accessToken,\n unit: 'metric',\n profile: 'mapbox/driving',\n });\n \n // Integrates directions control with map\n \n var geocoder = new MapboxGeocoder({ // Initialize the geocoder\n accessToken: mapboxgl.accessToken, // Set the access token\n mapboxgl: mapboxgl, // Set the mapbox-gl instance\n marker: false, // Do not use the default marker style\n });\n\n const ambientLight = new AmbientLight({\n color: [255, 255, 255],\n intensity: 1.0\n });\n \n const dirLight = new SunLight({\n timestamp: Date.UTC(2019, 7, 1, 22),\n color: [255, 255, 255],\n intensity: 1.0,\n _shadow: true\n });\n\n\n \n const lightingEffect = new LightingEffect({ambientLight, dirLight});\n lightingEffect.shadowColor = [0, 0, 0, 0.5];\n\n \n \n \n\n\n\n // Add geolocate control to the map.\n map.addControl(\n new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true\n },\n trackUserLocation: true\n }), \"top-right\"\n );\n //nav controls\n map.addControl(new mapboxgl.NavigationControl(),\"top-right\"); \n //map.addControl(new MapboxTraffic(),\"top-right\"); //requires mapbox-gl map\n map.addControl(directions, 'top-left');\n\n\n //deck layers\n\n //scatterplot\n const scatterLayer = new ScatterplotLayer({\n id: \"scatter-plot\",\n data:\n \"https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/scatterplot/manhattan.json\", //will take json geo json etc\n radiusScale: 40,\n radiusMinPixels: 0.5,\n getPosition: d => [d[0], d[1]],\n getFillColor: [255, 0, 0, 100],\n parameters: {\n depthMask: true,\n depthTest: true,\n blendFunc: [GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ONE_MINUS_SRC_ALPHA],\n blendEquation: GL.FUNC_ADD\n }\n });\n\n //terrain\n\n const terrainLayer = new TerrainLayer({\n elevationDecoder: {\n rScaler: 2,\n gScaler: 0,\n bScaler: 0,\n offset: 0\n },\n // Digital elevation model from https://www.usgs.gov/\n elevationData: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/terrain.png',\n texture: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/terrain-mask.png',\n bounds: [-122.5233, 37.6493, -122.3566, 37.8159],\n });\n\n const landCover = [[[-123.0, 49.196], [-123.0, 49.324], [-123.306, 49.324], [-123.306, 49.196]]];\n\n const polygonLayer = new PolygonLayer({\n id: 'ground',\n data: landCover,\n stroked: false,\n getPolygon: f => f,\n getFillColor: [0, 0, 0, 0]\n });\n\n const geoJSONLayer = new GeoJsonLayer({\n id: 'geojson',\n data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/geojson/vancouver-blocks.json',\n opacity: 0.8,\n stroked: false,\n filled: true,\n extruded: true,\n wireframe: true,\n getElevation: f => Math.sqrt(f.properties.valuePerSqm) * 10,\n getFillColor: f => COLOR_SCALE(f.properties.growth),\n getLineColor: [255, 255, 255],\n pickable: true\n }); \n\n\n \n //arc layer\n\n\n const arclayer = new ArcLayer({\n id: 'deckgl-arc',\n type: ArcLayer,\n data: [\n {source: [-122.3998664, 37.7883697], target: [-122.400068, 37.7900503]}\n ],\n getSourcePosition: d => d.source,\n getTargetPosition: d => d.target,\n getSourceColor: [255, 208, 0],\n getTargetColor: [0, 128, 255],\n getWidth: 8\n });\n\n // contour layer\n const contourLayer = new ContourLayer({\n id: 'contourLayer',\n data:\n 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/screen-grid/ca-transit-stops.json',\n getPosition: d => d,\n contours: [\n {threshold: 1, color: [255, 0, 0], strokeWidth: 4},\n {threshold: 5, color: [0, 255, 0], strokeWidth: 2},\n {threshold: [6, 10], color: [0, 0, 255, 128]}\n ]});\n\n //point cloud layer\n\n const pointCloudLayer = new PointCloudLayer({\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,\n coordinateOrigin: [-122.4004935, 37.7900486, 100], // anchor point in longitude/latitude/altitude\n data: [\n {position: [33.22, 109.87, 1.455]}, // meter offsets from the coordinate origin\n\n ],\n\n }) \n\n \n\n //deck integration\n const deck = new Deck({\n gl: map.painter.context.gl,\n layers: [geoJSONLayer],//scatterLayer, terrainLayer, arclayer, contourLayer, pointCloudLayer ,geoJSONLayer, polygonLayer,\n effects: [lightingEffect],\n initialViewState: {\n latitude: 37.6493,\n longitude: -122.5233,\n zoom: 15\n },\n controller: true\n });\n // Add the geocoder to the map\n // map.addControl(geocoder, \"bottom-left\");\n\n\n //add deck layer\n const deckLayers= new MapboxLayer({ id: \"deck-gl-layer\", deck });\n map.on(\"load\", () => {\n map.addLayer(deckLayers);\n\n\n\n\n //loads 3d building layer on map loading\n //const firstLabelLayerId = map.getStyle().layers.find(layer => layer.type === 'symbol').id;\n \n \n map.addLayer({\n 'id': '3d-buildings',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['==', 'extrude', 'true'],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#aaa',\n\n // use an 'interpolate' expression to add a smooth transition effect to the\n // buildings as the user zooms in\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .2\n }\n }); //firstLabelLayerId before parentheses close to add buildings back in \n\n });\n\n\n\n\n \n } \n \n\n\n \n render() {\n return (\n \n // Populates map by referencing map's container property\n
(this.mapWrapper = el)} className=\"mapWrapper\" />\n \n );\n }\n }\n \n export default App;\n\n ","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\n\nimport Map from './map';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\nimport Directions from \"./directions\"\n\nReactDOM.render(\n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}