当前位置:网站首页>ArcGIS js api 4. X submergence analysis and water submergence analysis
ArcGIS js api 4. X submergence analysis and water submergence analysis
2022-04-23 20:17:00 【Tomorrow's sun】
The renderings are as follows :
ArcGIS js 4.x Flooding analysis Inundation analysis
The code is as follows
console.log('[email protected]');
function gradientColor(startColor,endColor,step){
startRGB = this.colorRgb(startColor);// Convert to rgb Array mode
startR = startRGB[0];
startG = startRGB[1];
startB = startRGB[2];
endRGB = this.colorRgb(endColor);
endR = endRGB[0];
endG = endRGB[1];
endB = endRGB[2];
sR = (endR-startR)/step;// Total difference
sG = (endG-startG)/step;
sB = (endB-startB)/step;
var colorArr = [];
for(var i=0;i<step;i++){
// Calculate the of each step hex value
var hex = this.colorHex('rgb('+parseInt((sR*i+startR))+','+parseInt((sG*i+startG))+','+parseInt((sB*i+startB))+')');
colorArr.push(hex);
}
return colorArr;
}
// take hex The representation is converted to rgb Representation ( Return here rgb Array mode )
gradientColor.prototype.colorRgb = function(sColor){
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase();
if(sColor && reg.test(sColor)){
if(sColor.length === 4){
var sColorNew = "#";
for(var i=1; i<4; i+=1){
sColorNew += sColor.slice(i,i+1).concat(sColor.slice(i,i+1));
}
sColor = sColorNew;
}
// Handle six bit color values
var sColorChange = [];
for(var i=1; i<7; i+=2){
sColorChange.push(parseInt("0x"+sColor.slice(i,i+2)));
}
return sColorChange;
}else{
return sColor;
}
};
// take rgb The representation is converted to hex Representation
gradientColor.prototype.colorHex = function(rgb){
var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if(/^(rgb|RGB)/.test(_this)){
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g,"").split(",");
var strHex = "#";
for(var i=0; i<aColor.length; i++){
var hex = Number(aColor[i]).toString(16);
hex = hex<10 ? 0+''+hex :hex;// Make sure that each rgb The value of is 2 position
if(hex === "0"){
hex += hex;
}
strHex += hex;
}
if(strHex.length !== 7){
strHex = _this;
}
return strHex;
}else if(reg.test(_this)){
var aNum = _this.replace(/#/,"").split("");
if(aNum.length === 6){
return _this;
}else if(aNum.length === 3){
var numHex = "#";
for(var i=0; i<aNum.length; i+=1){
numHex += (aNum[i]+aNum[i]);
}
return numHex;
}
}else{
return _this;
}
}
版权声明
本文为[Tomorrow's sun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210553339959.html
边栏推荐
- WordPress插件:WP-China-Yes解决国内访问官网慢的方法
- 如何在BNB鏈上創建BEP-20通證
- R语言survival包coxph函数构建cox回归模型、ggrisk包ggrisk函数和two_scatter函数可视化Cox回归的风险评分图、解读风险评分图、基于LIRI数据集(基因数据集)
- R语言使用timeROC包计算无竞争风险情况下的生存资料多时间AUC值、使用confint函数计算无竞争风险情况下的生存资料多时间AUC指标的置信区间值
- R language survival package coxph function to build Cox regression model, ggrisk package ggrisk function and two_ Scatter function visualizes the risk score map of Cox regression, interprets the risk
- SIGIR'22 "Microsoft" CTR estimation: using context information to promote feature representation learning
- Compact CUDA tutorial - CUDA driver API
- The second method of file upload in form form is implemented by fileitem class, servletfileupload class and diskfileitemfactory class.
- selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
- PCL点云处理之基于PCA的几何形状特征计算(五十二)
猜你喜欢
antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题
Wave field Dao new species end up, how does usdd break the situation and stabilize the currency market?
DTMF dual tone multi frequency signal simulation demonstration system
程序设计语言基础(2)
Sqoop imports tinyint type fields to boolean type
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (VII)
Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
MySQL 进阶 锁 -- MySQL锁概述、MySQL锁的分类:全局锁(数据备份)、表级锁(表共享读锁、表独占写锁、元数据锁、意向锁)、行级锁(行锁、间隙锁、临键锁)
随机推荐
Kubernetes introduction to mastery - ktconnect (full name: kubernetes toolkit connect) is a small tool based on kubernetes environment to improve the efficiency of local test joint debugging.
记录:调用mapper报空指针;<foreach>不去重的用法;
LeetCode异或运算
How to do product innovation—— Exploration of product innovation methodology I
nc基础用法
LeetCode动态规划训练营(1~5天)
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
Notes of Tang Shu's grammar class in postgraduate entrance examination English
selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
DNS cloud school | analysis of hidden tunnel attacks in the hidden corner of DNS
中金财富公司怎么样,开户安全吗
网络通信基础(局域网、广域网、IP地址、端口号、协议、封装、分用)
Redis distributed lock
Cadence Orcad Capture CIS更换元器件之Link Database 功能介绍图文教程及视频演示
NC basic usage 1
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题
PCL点云处理之计算两平面交线(五十一)
Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration