开放层投影

发布于 2024-10-08 09:09:07 字数 71 浏览 0 评论 0原文

我想缩放到谷歌地图中的特定房屋,但是当我提供其边界以及纬度和经度时,它不会显示图像以及特定房屋。任何人都可以为此提供解决方案吗?

I want to zoom to a particular house in the google mapS, but when I provide its bounds and lattitude and longitude, it does not show images as well as the particular house. Can anyone provide the solution for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

以往的大感动 2024-10-15 09:09:07

解决方案可能是首先传输坐标。不幸的是,当您将坐标传递给 OpanLayers.LonLat(lon,lat) 时,它应该是 WGS:84,而 OpenLayer.Bounds() 需要 EPSG:900913 中给出的坐标。
然后,您应该使用 Proj4js.transform 并在 EPSG:900913 中传递转换后的坐标

Solution would be probably to transporm coordinates first. Unfortunately when You pass coordinates to OpanLayers.LonLat(lon,lat) it is supposed to be WGS:84, while OpenLayer.Bounds() needs coordinates given in EPSG:900913.
You should then use Proj4js.transform and pass transformed coordintes in EPSG:900913

喜爱皱眉﹌ 2024-10-15 09:09:07

你可以像这样改造它:

var map = new OpenLayers.Map('map');
var location.transform(map.getProjectionObject(), new OpenLayers.Projection("EPSG:900913"));

You can transform it like this one:

var map = new OpenLayers.Map('map');
var location.transform(map.getProjectionObject(), new OpenLayers.Projection("EPSG:900913"));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文