当前位置:网站首页>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
边栏推荐
- Cadence OrCAD capture batch change component packaging function introduction graphic tutorial and video demonstration
- SQL Server connectors by thread pool 𞓜 instructions for dtsqlservertp plug-in
- Is the wechat CICC wealth high-end zone safe? How to open an account for securities
- LeetCode动态规划训练营(1~5天)
- Design of warehouse management database system
- R语言使用caret包的preProcess函数进行数据预处理:对所有的数据列进行BoxCox变换处理(将非正态分布数据列转换为正态分布数据、不可以处理负数)、设置method参数为BoxCox
- selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
- Cadence Orcad Capture 批量更改元件封装功能介绍图文教程及视频演示
- 考研英语唐叔的语法课笔记
- How about CICC fortune? Is it safe to open an account
猜你喜欢

Mysql database backup scheme

SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
![Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]](/img/1a/669c330e64af8e75f4b05e472d03d3.png)
Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]

MySQL advanced lock - overview of MySQL locks and classification of MySQL locks: global lock (data backup), table level lock (table shared read lock, table exclusive write lock, metadata lock and inte

Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)

山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)

Openharmony open source developer growth plan, looking for new open source forces that change the world!

Redis cache penetration, cache breakdown, cache avalanche

程序设计语言基础(2)

PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
随机推荐
Use the rolling division method to find the maximum common divisor of two numbers
Numpy Index & slice & iteration
DTMF dual tone multi frequency signal simulation demonstration system
Database query - course selection system
Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration
记录:调用mapper报空指针;<foreach>不去重的用法;
PCL点云处理之计算两平面交线(五十一)
SIGIR'22 "Microsoft" CTR estimation: using context information to promote feature representation learning
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
Investigate why close is required after sqlsession is used in mybatties
Mysql database - connection query
How to protect ECs from hacker attacks?
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
如何在BNB鏈上創建BEP-20通證
STM32 Basics
Leetcode dynamic planning training camp (1-5 days)
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
nc基础用法
Fundamentals of network communication (LAN, Wan, IP address, port number, protocol, encapsulation and distribution)
Numpy - creation of data type and array