true && number !== boolean
true && number !== boolean
bug
let result = ``;
// section, name ? create text, compute center point : no need render text
// feature, labelPoint ??? show text
// if (type === `section` && name) {
// if (type === "section" && name) {
// true && number !== boolean
if (type === "section" && name.length ? true : false) {
// log(`绑定的选区 properties`, JSON.stringify(feature.properties, null, 4));
// fillColorReverser(fill);
// const areaUuid = `area` + uuid.slice(7);
const ticketArea = {
id,
activityEventId,
ticketCategoryId,
desc,
name,
floor,
sort,
status,
};
const areaProps = JSON.stringify(ticketArea);
// areaprops areaProps auto convert to lowercase bug / xyzUFO="bug"
result = `
<polygon stroke="${stroke || ''}" fill="${fill || polygonFillColor}" points="${points}" center='${center}' areaprops='${areaProps} uuid="${uuid}"></polygon>
<text x="${x || ''}" y="${y || ''}" fill="${textFillColor}" uuid="${areaUuid}">${name}</text>
`;
} else {
result = `
<polygon stroke="${stroke || ''}" fill="${fill || polygonFillColor}" points="${points}" center='${center}' uuid="${uuid}"></polygon>
`;
}
error
type = "section";
"section"
name = `贵宾区`;
"贵宾区"
type === "section" && name
"贵宾区"
type === "section" & name
0
type === "section" & name.length
1
type === "section" && name.length
3
type === "section"
true
name.length
3

OK
type === "section" && (name.length ? true : false)
// true
type === "section" && name.length > 0
// true

true && number !== boolean的更多相关文章
- js中parseInt()与parseFloat(),Number(),Boolean(),String()转换
js将字符串转数值的方法主要有三种 转换函数.强制类型转换.利用js变量弱类型转换. 1. 转换函数: js提供了parseInt()和parseFloat()两个转换函数.前者把值转换成整数,后者把 ...
- js五种基本数据类型:string, number, boolean, null, undefined
/** * 五种基本数据类型:string, number, boolean, null, undefined */ // undefined // 声明变量foo,未声明变量bar var foo; ...
- javascript总结27 :特殊引用类型String/Number/Boolean
为了方便操作基本数据类型,JavaScript还提供了三个特殊的引用类型:String/Number/Boolean 1 Number 例如: var s1 = "zhangsan&quo ...
- Boolean.parseBoolean("true") 和 Boolean.getBoolean("true");的区别及用法
正确用法:boolean repeatIndicator = Boolean.valueOf("true").booleanValue();或者也可以使用Boolean.parse ...
- JavaScript基本数据类型及其转换规则
ECMAScript 数据类型 ECMAScript中有五种基本数据类型:Undefined, Null, Boolean, Number, String 一种复杂数据类型:Object 数据类型检测 ...
- svg insert shape string bug
svg insert shape string bug not support custom areaProps attributes ??? const svg = document.querySe ...
- javascript之基本包装类型(Boolean,Number,String)基础篇
前几天整理了javascript中Array方面的知识,但是String中的一些方法多多少少和Array里的方法有些类似容易混淆,就顺便连同String所在的包装类一起整理一下,希望可以帮助到初学者, ...
- JavaScript Math和Number对象
目录 1. Math 对象:数学对象,提供对数据的数学计算.如:获取绝对值.向上取整等.无构造函数,无法被初始化,只提供静态属性和方法. 2. Number 对象 :Js中提供数字的对象.包含整数.浮 ...
- ES6(四) --- 正则 Number Math
想学vue了 重启ES6的学习之路 在ES5 中正则的构造器 RegExp 不支持第二个参数 ES6 做了调整 第二个参数表示正则表达式的修饰符(flag) var regex = new ...
随机推荐
- HDFS HBase Solr Which one? 从访问模式角度决策
HDFS 压缩性能最优.扫描速度最快:不支持随机访问,仅支持昂贵.复杂的文件查询 HBase适合随机访问 Solr 适合检索需求 HBase访问单个记录的时间为毫秒级别,而HDFS不支持随机访问. H ...
- 本地MarkDown优雅发表
本地MarkDown优雅发表 前言 身为一名程序员,记录笔记.发表博客首选便是MarkDown,现在网上有好多发表博客的地方:CSDN.博客园.简书,甚至一些大佬都有自己专属博客,但自己最喜欢的还是博 ...
- Spring听课笔记(专题二)
第3章 Spring Bean的装配(上) 3-1:配置项及作用域 1.Bean的配置项: -- Id -- Class (这个必须,其他的都可以不配置) -- Scope (作用域) -- Cons ...
- PowerQuery合并查询原理
PowerQuery的合并查询比Excel中的VLOOKUP更加强大,下面对查询的类型做一个梳理, 1.左外部(第一个中的所有行,第二个中的匹配行):用左边表内的所有行去右边找它的匹配项 2.右外部( ...
- HTML5.1 新增的14项特性学习
1.防止网络钓鱼攻击 使用target=_'blank'时, 新打开的标签可以更改window.opener.location到一些钓鱼网站,它会在开放页面上代表你执行一些Javascript代码.为 ...
- 用于理解Java的前8个图表
尤其记得高中上数学课的时候,数学老师课堂上最喜欢说的一句话:"数形结合百般好":这些年过去,数学虽然学的并未多么好,但这句话倒是一直烙印在我的脑海,在其他学科的学习当中,我总是尽量 ...
- Spark运行程序异常信息: org.apache.spark.SparkException: Task not serializable 解决办法
错误信息: 17/05/20 18:51:39 ERROR JobScheduler: Error running job streaming job 1495277499000 ms.0 org.a ...
- scanf()函数释疑(word找的,没源地址了)
scanf()函数释疑(上) 一.序言 scanf()函数的控制串的使用 例1. #include "stdio.h" int main(void) { int a,b,c; sc ...
- linux(7)top命令详细解释
top命令 Linux top命令用于实时显示 process 的动态. top参数详解 第一行,任务队列信息 系统当前时间:13:52:56 系统开机后到现在的总运行时间:up 66 days,8m ...
- fzu2204 7
Problem Description n个有标号的球围成一个圈.每个球有两种颜色可以选择黑或白染色.问有多少种方案使得没有出现连续白球7个或连续黑球7个. Input 第一行有多组数据.第一行T表 ...