Leaflet.js与非真实世界地图!坐标 [英] Leaflet.js with a non real world map! Coordinates

查看:433
本文介绍了Leaflet.js与非真实世界地图!坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用传单JS创建Day Z(游戏)的地图,并希望
能够使用游戏坐标系在地图上绘制项目,请参阅
http://dayz.ollieb.net

I'm working on creating a map of Day Z (the game) with leaflet JS and want to be able to plot items on the map using the in game coordinate system see http://dayz.ollieb.net

在游戏中排名第一左坐标是000 000,然后是001,001,其中10的单位表示网格,因此010,010将是左上角的网格(类似于法令调查)。

In game the top left coordinate is 000 000, then 001, 001 where units of 10 represent a grid so 010, 010 would be the top left "grid" (similar to ordinance survey).

如何创建一个方法来转换提供的坐标系(
points或latlong)以这种方式工作。基本上他们只需要从$ b $ 000 000(左上)到145,130(右下)。目前我使用lat / long时遇到
麻烦,因为它曲线来补偿投影,
点(x / y)似乎每台计算机都有变化!

How do I create a method to convert the provided coordinate systems (either points or latlong) to work on this way. Basically they just need to go from 000, 000 (top left) to 145, 130 (bottom right). Currently I am having trouble using lat/long as it curves to compensate for the projection and points (x/y) seem to change per computer!

如何获取游戏点并在地图上创建
点的标记?据推测,我需要告诉Leaflet.js左上角的数字和地图右下方的
是什么?

How can I take an in game point and create a marker on the map at that point? Presumably I need to tell Leaflet.js what "number" the top left and bottom right of the map are somehow?

对于缺乏理解感到抱歉,我已经阅读了所有文档,并且
看不到这样的内容!

Sorry for the lack of understanding, I have read through all the docs and can't see anything like this mentioned!

在此处查看示例:
http://dabrothas.net/sei/daisy/index.asp?mode=mark&z=3&x=-109.2294921875&y = 73.49222029152183

推荐答案

我是Leaflet的作者。

I'm Leaflet author.

有关设置非世界CRS的代码示例,请查看以下问题: https://github.com/Leaflet/Leaflet/issues/210
https://github.com/Leaflet/Leaflet/pull/676

Check out the following issues for code examples on setting up a non-world CRS: https://github.com/Leaflet/Leaflet/issues/210 https://github.com/Leaflet/Leaflet/pull/676

我打算做一些重构0.4版本的投影逻辑使这些事情变得更加容易和自然,敬请期待!

I plan to do some refactoring of projection logic for 0.4 release to make such things much easier and more natural, so stay tuned!

这篇关于Leaflet.js与非真实世界地图!坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆