I will chase, I will reach, I will fly.
前提就是想转换转换代码/** * 判断经纬度是否超出中国境内 */ function isLocationOutOfChina(latitude, longitude) { if (longitude < 72.004 || longitude > 137.8347 || latitude < 0.8293 || latitude > 55.8271) return true; return false; } /** * 将WGS-84(国际标准)转为GCJ-02(火星坐标): */ function transformFromWGSToGCJ(latitude, longitude) { var lat = ""; var lon = ""; var ee = 0.00669342162296594323; var a = 6378245.0; var pi = 3.14159265358979324; if (isLoca
实现代码// 位置变化监听 // 文档地址 https://www.html5plus.org/doc/zh_cn/geolocation.html# plus.geolocation.watchPosition( position => { //console.log('plus.geolocation.watchPosition position', position); // todo 缓存定位或者上传定位 uni.setStorageSync('watchPosition', position) // 108.307424,22.799393 var point = new plus.maps.Point(position.coords.longitude, position.coords.latitude); ts.autoUploadPoint({lng:position.coords.longitude,lat:position.coords.latitude}) plus.maps.Map.reverseGe
前言APP在不同网络下,由于网络延迟的问题会使得用户无法请求导致心情不愉快,所以咱们得做个网络不好的提示。实现// 网络状态监听 uni.onNetworkStatusChange(function (res) { console.log('onNetworkStatusChange', res.isConnected, res.networkType); if(!res.isConnected) { uni.showToast({ title: "无网络连接!", icon: "error", duration: 3500 }); } let message = null; switch(res.networkType) { case '2g': case '3g': message = '当前网络质量不佳!';
简介JavaScript implementations of standard and secure cryptographic algorithmsCryptoJS is a growing collection of standard and secure cryptographic algorithms implemented in JavaScript using best practices and patterns. They are fast, and they have a consistent and simple interface.标准和安全加密算法的 JavaScript 实现CryptoJS 是使用最佳实践和模式在 JavaScript 中实现的标准和安全加密算法的不断增长的集合。 它们速度很快,并且具有一致且简单的界面。文档CryptoJS Gitbook实现代码 import crypto from 'crypto'; import config from '~/config'; // Defining key const key = crypto.r
需求obj1={ a:'asd', b:'aassd', c:'assdfd', d:'asfdgd' } obj2={ a:'', c:'' }结果obj2={ a:'asd', c':assdfd' }实现Object.keys(obj2).map(function(key){ obj1[key] && (obj2[key] = obj1[key]); })
lettered
生,亦我所欲也;义,亦我所欲也。