maps

OpenLayers加载谷歌地图服务

天大地大妈咪最大 提交于 2020-03-23 14:37:33
谷歌地图的地址如下: 谷歌交通地图地址:http://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i380072576!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0, 平面图地址2:http://www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}, 影像图地址:http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}, 影像注记层地址:http://www.google.cn/maps/vt?lyrs=h@189&gl=cn&x={x}&y={y}&z={z}, 地形图层:http://www.google.cn/maps/vt?lyrs=t@189&gl=cn&x={x}&y={y}&z={z} 代码如下: var tdtLayer = new ol.layer.Tile({ title: "谷歌矢量地图服务", source: new ol.source.XYZ({ url: "http://www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}

Result Maps、Auto-mapping、cache

二次信任 提交于 2020-03-22 16:23:34
1. Result Map s resultMap元素是Mybatis里面最重要的并且功能最强大的一个元素。(The resultMapelement is the most important and powerful element in MyBatis.)与JDBC从ResultSets中取值相比较它可以使用节省大约90%的代码。不过多的说了,下面开始resutMap之旅~ 一个最简单的例子 首先XML里面定义个resultMap,如下: Xml代码 < resultMap type= "com.ggg.henushang.entity.Person" id= "personMap" > < id column= "id" property= "id" /> < result column= "name" property= "name" /> < result column= "age" property= "age" /> </ resultMap > 然后就可以使用了,如下: Xml代码 < select id= "getPersonMap" resultMap= "personMap" > select * from person </ select > 注意,在这里就没有了resultType这个属性了,而是使用了resultMap dao中的代码: Java代码

通过两个点的经纬度计算距离

巧了我就是萌 提交于 2020-03-21 10:23:10
通过两个点的经纬度计算距离 从google maps的脚本里扒了段代码,没准啥时会用上。大家一块看看是怎么算的。 private const double EARTH_RADIUS = 6378.137; private static double rad(double d) { return d * Math.PI / 180.0; } public static double GetDistance(double lat1, double lng1, double lat2, double lng2) { double radLat1 = rad(lat1); double radLat2 = rad(lat2); double a = radLat1 - radLat2; double b = rad(lng1) - rad(lng2); double s = 2 * Math.Asin(Math.Sqrt(Math.Pow(Math.Sin(a/2),2) + Math.Cos(radLat1)*Math.Cos(radLat2)*Math.Pow(Math.Sin(b/2),2))); s = s * EARTH_RADIUS; s = Math.Round(s * 10000) / 10000; return s; } 从google maps的脚本里扒了段代码

Codeforces Round #483 (Div. 2) B题

◇◆丶佛笑我妖孽 提交于 2020-03-20 09:42:01
B. Minesweeper time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Minesweeper that time. He imagined that he saved world from bombs planted by terrorists, but he rarely won. Alex has grown up since then, so he easily wins the most difficult levels. This quickly bored him, and he thought: what if the computer gave him invalid fields in the childhood and Alex could not win because of it? He

zznu组队赛⑧

杀马特。学长 韩版系。学妹 提交于 2020-03-20 02:14:42
论如何优雅地暴力? Problem A: 题意:ZCC在玩一个游戏, 在这个游戏中他有一个技能,可以把一张牌变成他想要的样子. 现在给出5张牌,问ZCC至少需要多少次可以把5张牌变成同花顺. (A,B,C,D分别表示4种花色的牌,每种花色有1,2,3,4....13), 同花顺首先花色必须相同,然后花色后面的数字必须依次递增 比如1,2,3,4,5 10,11,12,13,1 都被看成顺子,而11,12,13,1,2 则不是. 没什么技巧, 暴力枚举 #include<stdio.h> #include<stdlib.h> #include<string.h> #include<queue> #include<algorithm> #include<cmath> #include<iostream> using namespace std; typedef long long LL; #define oo 1000000007 #define mod 1000000007 #define maxn 205 int maps[maxn][maxn]; void get(char s[]) { int x = s[0]-'A'+1; int y = 0; for(int i = 1; s[i]; i++) y = y*10+s[i]-'0'; maps[x][y] = 1; } /

merging palettes with colorRampPalette and plotting with leaflet

非 Y 不嫁゛ 提交于 2020-03-16 07:21:51
问题 I'm trying to merge two colorRampPalette schemes to use in leaflet and have been following this nice example. That example works fine but I can't seem to get it to work for my work, reproducible example below. I'm using RdYlGn palette and I want numbers below the threshold to be dark green and numbers above the threshold to more red (skipping some of the inner colors). For my example my cut-off is nc$PERIMETER < 1.3 so I want numbers under this value to be green and everything above more red

使用面向对象的方式书写jQuery业务代码

拜拜、爱过 提交于 2020-03-09 18:19:20
因为公司还有还有一些老项目使用的是前后端不分离的形式,不得不采用jQuery作为技术栈进行前端开发。考虑到函数排序很随性可能导致后期维护麻烦的情况,按照知乎小爝Live所推荐的方式做了一次改版,感觉还行,特来分享。 整体页面结构如下 ;(function (global, $, doc) { ‘use strict’; var Application = function () { this.a = 1, this.b = 2, this.eventsMap = { “click #btnOne”: “funcOne”, “click #btnTwo”: “funcTwo” } this.initEvent(); }; Application.prototype = { constructor: ‘Application’, funcOne: function () { console.log(‘You are clicked btn one!’); }, funcTwo: function () { console.log(‘You are clicked btn two!’); } }; global.Application = Application; $(function () { new Application() }); })(this, jQuery, jQuery

How to convert polar system to latitude and longitude

老子叫甜甜 提交于 2020-03-05 07:29:06
问题 i am trying to develop an android app . I use a web service that require my location in latitude and longitude (where i am standing) and giving a feedback another location data. But, the another location data is given with polar system which the origin of polar system is the place where i stand. My question is, how to convert the given polar system data (distance, and degree from the north) to be the another location's latitude and longitude. ? Sorry for my bad english. 回答1: Use formula:

How to convert polar system to latitude and longitude

≯℡__Kan透↙ 提交于 2020-03-05 07:28:21
问题 i am trying to develop an android app . I use a web service that require my location in latitude and longitude (where i am standing) and giving a feedback another location data. But, the another location data is given with polar system which the origin of polar system is the place where i stand. My question is, how to convert the given polar system data (distance, and degree from the north) to be the another location's latitude and longitude. ? Sorry for my bad english. 回答1: Use formula:

(16/24) webpack打包后的调试方法

只愿长相守 提交于 2020-03-05 06:57:12
在程序开发中,调试程序是最频繁的,那使用了webpack后,所有的代码都打包到了一起,这给调试带来了困难,但是webpack在设计时就已经考虑好了这点,它支持生产Source Maps来方便我们的调试。 Source Maps能够提供将压缩文件恢复到源文件原始位置的映射代码的方式,在Chrome和Firefox的开发工具既附带内置的Source Maps的支持。 Source Maps详细学习 在使用webpack时只要通过简单的devtool配置,webapck就会自动给我们生产source maps 文件,map文件是一种对应编译文件和源文件的方法,使调试变得简单。 在配置devtool时,webpack给我们提供了四种选项。 1.source-map:在一个单独文件中产生一个完整且功能完全的 .map 文件(能定位到具体某行某个位置)。这个文件具有最好的source map,但是它会减慢打包速度; 在webpack.config.js中的入口文件上方配置: module.exports = { devtool: 'eval-source-map', //配置调试 entry: "", output: {} } 打包后的结果: 2.cheap-module-source-map:在一个单独的文件中产生一个不带列映射的map(会告诉你具体某行出错,而不能具体到某行某个位置出错。)