openmap

使用uni-app 框架,调用第三方导航

拈花ヽ惹草 提交于 2020-08-18 20:42:56
使用uni-app 框架,调用第三方导航 //transformCoordinate.js /** * Created by Wandergis on 2015/7/8. * 提供了百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换 */ //定义一些常量 var x_PI = 3.14159265358979324 * 3000.0 / 180.0 ; var PI = 3.1415926535897932384626 ; var a = 6378245.0 ; var ee = 0.00669342162296594323 ; /** * 百度坐标系 (BD-09) 与 火星坐标系 (GCJ-02)的转换 * 即 百度 转 谷歌、高德 * @param bd_lon * @param bd_lat * @returns {*[]} */ function bd09togcj02 ( bd_lon , bd_lat ) { var x_pi = 3.14159265358979324 * 3000.0 / 180.0 ; var x = bd_lon - 0.0065 ; var y = bd_lat - 0.006 ; var z = Math . sqrt ( x * x + y * y ) - 0.00002 * Math . sin (

Java室内最短路径搜索(支持多楼层)

感情迁移 提交于 2020-08-10 06:40:33
修改了上次的代码,现在支持室内的多楼层情况下的最短路径搜索,还是使用A*算法,把在GraphAdjList中VNode没有利用起来的data字段作为我们存储楼层属性的位置。 实际上是我偷懒了,正常情况下VNode里应该再加一个int level属性,而data还是作为绑定用户想添加任意类型的数据的一个位置来使用,这样例如当用户想对任意节点添加String类型的描述时,声明GraphAdjList<String>即可,但现在我们的GraphAdjList只能声明为GraphAdjList<Integer>,因为我们把data作为楼层属性来使用,名存实亡的模板类hh。 用户添加节点时使用GraphAdjList.insertVex(E v,int index,int x,int y),v 楼层,index 节点的唯一序列号(从1开始,符合生活习惯),x,y是点坐标,添加边的操作与上次不变。 需要注意的是,在我们的A*代码中,f=g+h,启发函数h设置的可能不是很理想,我们仍旧沿用了x,y的曼哈顿距离,未考虑楼梯口位置和层数等因素的影响,如果遇到起点终点都在所属层的中心位置,楼梯电梯在每层的边缘,搜索方向会先往中心扩展,直到没有结果时,才会往边缘扩展,随后扩展到楼上或楼下,在这种情况下效率可能不佳,但仍旧能获得最短路径。简而言之,就是在我们现在设计的h下

Javascript - Getting null error despite using onreadystatechange

∥☆過路亽.° 提交于 2019-12-02 20:32:01
问题 . Hello y'all, I'm trying to implement this tutorial as a module in a page but I am getting a "weatherData.temperature is null" error. I had previously been getting a "weatherData.city is null" error but fixed it by using onreadystatechange on the js. I get that before I was getting the error because I was trying to setInnerHTML to something that was null because I hadn't wrapped the script in the onreadystatechange but now I'm stumped as to why I'm getting a similar error for a different

Using custom map image tiles in LeafletJS?

北城以北 提交于 2019-11-28 15:16:22
Do my tiles need to adhere to any particular specs? I have a large image file which I'd like to turn into a map with LeafletJS. I am going to be using the Python Imaging Library to cut it up into all the various tiles I need. However, I can't find any information about using custom maps in Leaflet. Do I provide Leaflet with the range of X,Y,Z info somehow? Do I give it the pixel size of each tile? Does it figure this out on its own? To put my question into one concise question: What do I need to do in order to have image files that can double as map tiles with LeafletJS, and what, if anything,

Using custom map image tiles in LeafletJS?

南楼画角 提交于 2019-11-27 09:07:26
问题 Do my tiles need to adhere to any particular specs? I have a large image file which I'd like to turn into a map with LeafletJS. I am going to be using the Python Imaging Library to cut it up into all the various tiles I need. However, I can't find any information about using custom maps in Leaflet. Do I provide Leaflet with the range of X,Y,Z info somehow? Do I give it the pixel size of each tile? Does it figure this out on its own? To put my question into one concise question: What do I need