区块链技术博客
www.b2bchain.cn

arcgis 4 与deckgl 整合 (二)求职学习资料

本文介绍了arcgis 4 与deckgl 整合 (二)求职学习资料,有助于帮助完成毕业设计以及求职,是一篇很好的资料。

对技术面试,学习经验等有一些体会,在此分享。

针对deckgl TripsLayer

我们构建采集器,目的是支持多种数据类型到 TripsLayer, 并且支持arcgis 服务

const axios = require('axios')  export default class TripsLayerParser {   static getDataFromUrl(url: string) {     return new Promise((resolve => {       const queryUrl = `${url}/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=%5B%5D&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentsOnly=false&datumTransformation=&parameterValues=&rangeValues=&f=geojson`;       axios.get(queryUrl).then((r: any) => {         let data = this.getTimestampFromGeoJson(r.data);         resolve(data);       });     }));   }    static getDataFromJsonUrl(url: string) {     return new Promise((resolve => {       axios.get(url).then((r: any) => {         let data = this.getTimestampFromGeoJson(r.data);         resolve(data);       });     }));   }    static getDataFromArray(array: any) {     return this.getTimestampFromArray(array);   }    private static getTimestampFromArray(lines: any) {     let data: any = [];     lines.forEach((line: any) => {       data.push({         path: line.geometry,         timestamps: this.getRandomTimestamp(line.geometry.length)       });     });     return data;   }    private static getTimestampFromGeoJson(dataArray: any) {     let lines = dataArray.features;      let data: any = [];     lines.forEach((line: any) => {       if (line.geometry.type === "MultiLineString") {         for (let item of line.geometry.coordinates) {           data.push({             path: item,             timestamps: this.getRandomTimestamp(item.length)           });         }       } else {         data.push({           path: line.geometry.coordinates,           timestamps: this.getRandomTimestamp(line.geometry.coordinates.length)         });       }     });     return data;   }    private static getRandomTimestamp(length: number) {     let timestamps: any = [];     for (let i = 0; i < length; i++) {       timestamps.push(i * 100);     }     return timestamps;   } }

封装的
“`javascript
import BaseLayer from “./BaseLayer”;
import TripsLayerParser from “./TripsLayerParser”;
import ColorManager from “./ColorManager”;
const {TripsLayer} = require(“@deck.gl/geo-layers”);

export default class DeckTripsLayer extends BaseLayer {

view: any;
options: any;

针对deckgl TripsLayer

我们构建采集器,目的是支持多种数据类型到 TripsLayer, 并且支持arcgis 服务

const axios = require('axios')  export default class TripsLayerParser {   static getDataFromUrl(url: string) {     return new Promise((resolve => {       const queryUrl = `${url}/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=%5B%5D&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentsOnly=false&datumTransformation=&parameterValues=&rangeValues=&f=geojson`;       axios.get(queryUrl).then((r: any) => {         let data = this.getTimestampFromGeoJson(r.data);         resolve(data);       });     }));   }    static getDataFromJsonUrl(url: string) {     return new Promise((resolve => {       axios.get(url).then((r: any) => {         let data = this.getTimestampFromGeoJson(r.data);         resolve(data);       });     }));   }    static getDataFromArray(array: any) {     return this.getTimestampFromArray(array);   }    private static getTimestampFromArray(lines: any) {     let data: any = [];     lines.forEach((line: any) => {       data.push({         path: line.geometry,         timestamps: this.getRandomTimestamp(line.geometry.length)       });     });     return data;   }    private static getTimestampFromGeoJson(dataArray: any) {     let lines = dataArray.features;      let data: any = [];     lines.forEach((line: any) => {       if (line.geometry.type === "MultiLineString") {         for (let item of line.geometry.coordinates) {           data.push({             path: item,             timestamps: this.getRandomTimestamp(item.length)           });         }       } else {         data.push({           path: line.geometry.coordinates,           timestamps: this.getRandomTimestamp(line.geometry.coordinates.length)         });       }     });     return data;   }    private static getRandomTimestamp(length: number) {     let timestamps: any = [];     for (let i = 0; i < length; i++) {       timestamps.push(i * 100);     }     return timestamps;   } }

封装的
“`javascript
import BaseLayer from “./BaseLayer”;
import TripsLayerParser from “./TripsLayerParser”;
import ColorManager from “./ColorManager”;
const {TripsLayer} = require(“@deck.gl/geo-layers”);

export default class DeckTripsLayer extends BaseLayer {

view: any;
options: any;

针对deckgl TripsLayer

我们构建采集器,目的是支持多种数据类型到 TripsLayer, 并且支持arcgis 服务

const axios = require('axios')  export default class TripsLayerParser {   static getDataFromUrl(url: string) {     return new Promise((resolve => {       const queryUrl = `${url}/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=%5B%5D&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentsOnly=false&datumTransformation=&parameterValues=&rangeValues=&f=geojson`;       axios.get(queryUrl).then((r: any) => {         let data = this.getTimestampFromGeoJson(r.data);         resolve(data);       });     }));   }    static getDataFromJsonUrl(url: string) {     return new Promise((resolve => {       axios.get(url).then((r: any) => {         let data = this.getTimestampFromGeoJson(r.data);         resolve(data);       });     }));   }    static getDataFromArray(array: any) {     return this.getTimestampFromArray(array);   }    private static getTimestampFromArray(lines: any) {     let data: any = [];     lines.forEach((line: any) => {       data.push({         path: line.geometry,         timestamps: this.getRandomTimestamp(line.geometry.length)       });     });     return data;   }    private static getTimestampFromGeoJson(dataArray: any) {     let lines = dataArray.features;      let data: any = [];     lines.forEach((line: any) => {       if (line.geometry.type === "MultiLineString") {         for (let item of line.geometry.coordinates) {           data.push({             path: item,             timestamps: this.getRandomTimestamp(item.length)           });         }       } else {         data.push({           path: line.geometry.coordinates,           timestamps: this.getRandomTimestamp(line.geometry.coordinates.length)         });       }     });     return data;   }    private static getRandomTimestamp(length: number) {     let timestamps: any = [];     for (let i = 0; i < length; i++) {       timestamps.push(i * 100);     }     return timestamps;   } }

封装的
“`javascript
import BaseLayer from “./BaseLayer”;
import TripsLayerParser from “./TripsLayerParser”;
import ColorManager from “./ColorManager”;
const {TripsLayer} = require(“@deck.gl/geo-layers”);

export default class DeckTripsLayer extends BaseLayer {

view: any;
options: any;

部分转自互联网,侵权删除联系

赞(0) 打赏
部分文章转自网络,侵权联系删除b2bchain区块链学习技术社区 » arcgis 4 与deckgl 整合 (二)求职学习资料
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

b2b链

联系我们联系我们