谷歌地图加载图像,如
我开始创建一个脚本,允许我将大图像分割成小块,进行缩放、拖动等。
我想知道有什么可能性可以在活动区域中加载小图像,例如在 Google 地图(可见)中。我想尝试使用一些计算来确定一个元素的大致位置,并使用 document.elementFromPoint 来确定该元素,但这不是跨浏览器解决方案。
另一个解决方案可能是:从头开始仅加载活动区域中的图像,当用户拖动或缩放时,脚本必须计算活动区域中的新元素。
请参阅此处我的意思是活动区域和非活动区域: https://i.sstatic.net/mRY5K.jpg< /a>
PS:我搜索了整个网站,但没有找到答案。我还阅读了这个主题: Google 地图如何工作? ,但我想我自己开发脚本。 (我不需要谷歌地图的复杂性,只需要几个功能)
I started to create a script that allows me to split a big image into small pieces,to zoom, drag , etc.
I want to know what are the possibilities to load the small images just in the active area like in Google Maps (visible). I thought to try to determine the approximate location of one element with some calcules and to determine the element with document.elementFromPoint, but it's not a cross browser solution.
Another solution could be: loading from the beginning just the images from active area and when the user drag or zoom the script must calculate the elements that are new in active area.
see here what I mean active and inactive area: https://i.sstatic.net/mRY5K.jpg
PS: I searched the entire site but I did not found an answer. I read also this topic : How does Google Maps work? , but I would like to develop myself the script. (I don't need the complexity of Google Maps, just few features)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 DeepZoom。它是一个开源项目,完全可以满足您的需求。它是为 .net 编写的...但我认为它可能就是您所寻找的
DeepZoom 是由 SeaDragon 创建的,并且是为 silverlight 构建的,但他们也有一个 Javascript 实现,称为 海龙 Ajax
Look into DeepZoom. Its an opensource project that does exactly what you want. Its written for .net... but i think it might be what your looking for
DeepZoom is created by SeaDragon and is built for silverlight but they also have a Javascript implementation too called SeaDragon Ajax