jVectorMap coordinates for the bbox
jVectorMap coordinates for the bbox
我创建了一个自定义的SVG国家地图,并用jVectorMap绘制了它。现在我正试图在这个地图上使用lat/long插入标记,但我不明白"bbox"x是如何;y系统工作。
我想我必须对地图的最大和最小纬度/长度进行反向投影,但即使在看下面的阿拉斯加例子时,我也不明白x是如何;y。我尝试使用proj.js中的inv_aea,但没有识别任何相关内容。
projection: {
centralMeridian: -100,
type: "aea"
}
insets: [{
"left": 0
"top": 440,
"width": 220,
"height": 147
"bbox":[{
"y": -8441281.712315228,
"x": -5263934.893342895
},{
"y": -6227992.545028123,
"x": -1949631.2950683108
}
}]
插入的宽度和高度必须等于贴图的宽度和宽度。
我真的不太明白你想做什么,但如果你想用图像作为地图插入标记,你必须考虑你的源坐标(纬度/经度对)是用WGS84(EPSG:4326)标准(椭球上的一个点)表示的,而你想在平面上表示它们。您应该使用全局球形mercators投影(请参见http://spatialreference.org/ref/epsg/3785/),以米为单位表示您的坐标(EPSG:3785)。一旦你完成了这个转换(我建议你使用这个库或类似的库:proj4js),你就可以进行简单的计算和比例,在平面地图上表示你的点。
我用两年多前上大学前做的一个例子建立了一个工作jsfiddle,我是一个编程初学者,所以请原谅糟糕的代码格式。
实时演示
you can check the live demo by clicking the link above
相关文章:
- Intercept the cellSubmit jqGrid
- CSS中的游标属性似乎不适用于USB On The Go
- Appending the innerhtml of <th>
- jquery in the middle of html
- Can't get the tail to wag (animate) in three.js?
- jquery.proxy in the bootstrap-typeahead.js context
- What is the difference between `HTMLImports.whenReady` and `
- confuse about the parentNode
- momentjs toISOString without the "z"
- toDataURL(), from the Web onto my Computer
- JavaScript Get the child id
- jquery insert-before to text in the same DOM
- JQuery DataPicker add on the
- jQuery: setInterval effects on the server?
- gulp-concat twice the content
- jqMath 突出显示框,如 MathJax/MathJs 中的 bbox
- What type is the 'return' keyword?
- Change the title on click of <li>
- DataTables-FixedHeader-多个tr in the ad对齐问题
- jVectorMap coordinates for the bbox