- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试绘制一个与国际日期变更线重叠的简单方框多边形。当前,在创建多边形时,它会以相反的方向环绕。
完整示例:http://jsfiddle.net/mcroteau/dkk2yu3L/
期望的输出:
实际输出:
Javascript:
var wgs84Proj = new ol.proj.Projection({ code : "EPSG:4326" });
var origProj = new ol.proj.Projection({ code : "EPSG:900913" });
var mapTile = new ol.layer.Tile({
source: new ol.source.OSM()
});
var convertedCoordinates = [];
var unformattedCoordinates = [[175, 70], [175, 60], [-160, 60], [-160, 70]];
$(unformattedCoordinates).each(function(index, coordinate){
var lat = coordinate[0];
var lon = coordinate[1];
var circle = new ol.geom.Circle([lat, lon])
circle.transform(wgs84Proj, origProj);
convertedCoordinates.push(circle.getCenter());
});
var polygonGeometry = new ol.geom.Polygon([convertedCoordinates])
var polygonFeature = new ol.Feature({ geometry : polygonGeometry });
var vectorSource = new ol.source.Vector();
vectorSource.addFeature(polygonFeature);
var vectorLayer = new ol.layer.Vector({
source: vectorSource
});
var mapView = new ol.View({
center: [-19000000, 9500000],
zoom: 3
})
var map = new ol.Map({
layers : [mapTile],
target : 'map',
view : mapView
});
map.addLayer(vectorLayer);
我不确定是否有我在 OpenLayers 3 API 中遗漏的配置设置或必须对数据点进行的转换。任何指导将不胜感激。
更新的工作示例
最佳答案
只需将 X 坐标加上 360 度(或所用投影的总宽度),即可使它们在世界中位于右侧。将 [[175, 70], [175, 60], [-160, 60], [-160, 70]]
更改为 [[175, 70], [175, 60 ], [200, 60], [200, 70]]
.
OpenLayers 使用投影坐标。 [-160, 70]
位于 [175, 70]
的左侧/西部,因此在两点之间绘制的任何线都将向左(如您的示例所示)。要使其向右/向东移动,您必须确保 X 坐标更高。
关于javascript - 开放层 3 : Drawing a polygon feature over the dateline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32260021/
有人查看我的代码说下面的 SQL 查询 (SELECT * FROM...) 显然容易受到攻击。我对此进行了研究,似乎我通过使用参数化查询正确地做到了这一点,但显然我遗漏了一些东西。 app.get(
我使用 Curie 作为基本模型,使用自定义数据集创建了一个微调模型。我正在使用 Azure OpenAI 服务。 该模型正在尝试使用最大可能的 token 生成响应。例如,如果 max_token
我正在尝试将6x15数组(映射)中的随机坐标设置为数字3,但前提是该坐标的值仍为0。我要放置的值为3) 25 int shipnum; 26 int x; 27 28 shipnum = 1;
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
您好,我正在寻找“开放”、“链接”和“多重哈希”算法的伪代码。是的,我花了很多时间在谷歌上搜索,但没能找到好东西。 如果你有分享的链接,我将不胜感激 问候 最佳答案 这hash table tutor
是否可以实现 Visitor Pattern尊重 Open/Closed Principle ,但仍然可以添加新的可访问类? 开放/封闭原则指出“软件实体(类、模块、函数等)应该对扩展开放,但对修改关
很难说出这里问的是什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或言辞激烈,无法以目前的形式合理回答。如需帮助澄清此问题以便可以重新打开,visit the help center . 12 年前
我创建了 Azure 开放 AI 服务我想针对特定问题训练模型。但是,自定义模板按钮被禁用。在文档中,它说明了如何生成包含要训练的问题和答案的 .Jsonl,但没有任何内容可以导入这些文件。有人拿到了
我找到了一些关于开放/封闭递归的解释,但我不明白为什么定义中包含“递归”一词,或者它与动态/静态调度相比如何。我找到的解释中有: Open recursion. Another handy featu
我正在尝试为在加权图上运行的库找出类设计。可以在这个图上执行各种算法,例如,找到两个节点之间的最短距离,两个节点之间的最长距离,两个节点之间距离小于 10 的路径数(比方说)等。 我关心的不是我所知道
谁能告诉我开放 SSL 和安全 SSL 之间的区别。 我已经在 Play 商店发布了新的 Android 应用程序,它使用远程 API。 在 API 服务器上,我已经成功安装了安全 SSL。但我仍然被
当我将 url 加载到 WebView 并尝试打开链接时,其中一些会显示如下错误页面: net::ERR_UNKNOWN_URL_SCHEME intent://maps.yandex.ru?utm_
2 月 24 日消息 据外媒 TheVerge 报道,2 月 23 日晚间,LG 宣布将该公司的 webOS 智能电视平台授权给其他电视厂商使用,目前 LG 已和 RCA、Ayonz 和康佳等电视厂
我一直在思考这个面向对象的设计问题,但无法提出令人满意的解决方案,所以我想在这里向人群开放以征求意见。 我有一个代表回合制棋盘游戏的 Game 类,出于这个问题的目的,我们可以假设它类似于 Monop
我们有一个 Web 服务,它充当我们的客户和另一个服务之间的网关。客户端向第三方服务发送消息并从其接收随机消息。客户端的服务器通过安全套接字打开到我们的 Web 服务器的 channel ,以便接收传
应用商店里有一个叫 Touchpad 的应用,最后一次更新是在 11 月 29 日,其中包含一个新功能,支持“使用设备键盘上的 Siri 键向电脑发送文本”,我想知道是否有开放的 API Siri现在
我尝试在认知搜索上下文中为 Azure 开放 AI 服务添加矢量搜索时遇到问题。选择勾选标记后,即使有可用的现有文本嵌入模型,我也无法列出任何模型。造成这种差异的可能原因是什么以及如何解决? 最佳答案
我尝试在认知搜索上下文中为 Azure 开放 AI 服务添加矢量搜索时遇到问题。选择勾选标记后,即使有可用的现有文本嵌入模型,我也无法列出任何模型。造成这种差异的可能原因是什么以及如何解决? 最佳答案
我们的堆栈:Tomcat 7、Spring 3.1.1、OpenJPA 2.2.0 我遇到了一个问题,根源是比较: server1.equals(server2); server1 和 server2
我正在使用以下命令设置一个 java EE 项目(打开)JPA。我使用 glassfish 4.0 作为我的应用程序服务器,但似乎无法让持久性发挥作用。 我面临的问题似乎是一个相当普遍的问题,因为同一
我是一名优秀的程序员,十分优秀!