通过点击图片(jQuery或javascript)动态生成地图区域坐标 [英] dynamically generate map area coords from clicks over an image (jquery or javascript)
问题描述
我想知道是否有一种方法可以通过单击图像的某些部分来动态生成地图区域坐标.这是为了生成完整的图像图.
I wondered if there is a way to generate map area coords dynamically by clicking certain parts of an image. This is in order to generate a full image map.
作为一个例子,我有这张图片:
As an example, I have this image:
并通过单击它,我想为每个定义的区域生成坐标,输出如下内容:
and by clicking on it, I want to generate coordinates for each defined area, outputing something like this:
<input type="text" name="36" value="25,11,25,117,47,117,46,29,83,31,84,8" />
<input type="text" name="37" value="83,12,103,32" />
等...
然后,我将其保存在数据库中,以供以后使用和处理.
Then I will save this on database for later use and processing.
我想做一些与本网站类似的事情,但是更简单.我只需要在画线时保持线条显示的功能,以供用户查看他在做什么,当然,还可以获取坐标.
I want to do something similar to what this website does, but more simple. I just need to maintain the functionality of displaying of the lines while drawing for the user to see what he is doing, and, off course, retrieve the coords.
是否有任何已经完成此工作的jquery插件,或者如何使用jquery或javascript来完成此任务.
Is there any jquery plugin that already does this job or how can I accomplish this by using jquery or javascript.
谢谢你
推荐答案
我们有相同的要求.我们最终使用了这个jQuery插件: http://odyniec.net/projects/imgareaselect/
We had the same requirements. And we ended up using this jQuery plugin: http://odyniec.net/projects/imgareaselect/
希望有帮助.
这篇关于通过点击图片(jQuery或javascript)动态生成地图区域坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!