JavaScript用户界面,理想的Bing地图或谷歌地图? [英] JavaScript UI for ideally Bing maps or Google maps?

查看:202
本文介绍了JavaScript用户界面,理想的Bing地图或谷歌地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Bing地图做了一个简单的概念验证网页。我需要在嵌入页面的地图上放置几个针脚。然后,一个JavaScript用户界面将使它如此,当用户勾选或取消挑选某些框时,结果被过滤,因此不同的引脚将变得可见或不可见。



对于开放性这个问题,但我怎么去做这件事?我更喜欢使用jQuery而不是普通的JavaScript。它只是一个概念证明,所以速度,性能,可靠性等都非常灵活。我需要像Silverlight这样的微软工具吗?

如果我可以在Bing地图上做到这一点,那么最好,但如果Google地图更容易处理,那么我也可以灵活处理。谢谢

解决方案

我用Google地图做了类似的事情。我几乎完成了所有jQuery,除了一些我需要JavaScript的地方。



这是一个非常高级的描述。我将标记按照我们称为区域的内容进行分类,并且当用户单击与该区域相对应的数字时,所有属于该区域的标记都将被绘制在地图上。

在地图加载时,我会打到标记的JSON文件(我缓存位于数据库表中的标记信息),并按区域将它们存储在数组中的物体。我使用了唯一的ID,因此我可以指定要绘制的标记。如果您使用复选框或单选按钮,则可以使用value属性
它是多维的,因此它看起来像这样:

  markers_obj [region] [marker] 

如果用户再次点击该区域,将其从地图中移除。



最让我感动的是看到其他人是如何完成类似于我试图实现的任务的。有大量信息用于与Google地图进行互动。不幸的是,我对Bing地图没有任何经验。



以下是一些指向Google地图API的链接,它们提供的代码示例和演示。 b
$ b



如果您有任何关于什么的问题,请告知我我描述过,它可能有点含糊。


Im making a simple proof of concept webpage using Bing maps. I need to have several pins on a map which is embedded in my page. Then a javascript UI will make it so when users tick or untick certain boxes the results are filtered, so different pins will be made visible or invisible.

Sorry for the openness of this question but how do I go about doing this? Id much rather work with jQuery than plain JavaScript. Its only a proof of concept so speed, performance, reliability, etc are all flexible. Do I need microsoft tools like silverlight?

It would be best if I could do this with Bing maps but if Google maps is far easier to work with then I can be flexible on this too. Thanks

解决方案

I have done something similar this with Google maps. I pretty much did it with all jQuery except for some areas where I needed JavaScript.

Here's a very high level description. I had markers classified by what we will call regions and when a user clicked on the number corresponding to that region all of the markers that belong to that region were then plotted on the map.

On load of the map I would hit my JSON file of markers (I cache the marker information that is located in a DB table) and store them by region in an array of objects. I used unique IDs so I would be able to specify what markers to plot. If you're using checkboxes or radio buttons you can use the value attribute, It was multidimensional so it looked like this:

markers_obj[region][marker]

If the user clicked that region again the markers would then be removed from the map.

What helped me most was looking at how other people had accomplished tasks similar to what I was trying to achieve. There is a wealth of information out there for interacting with google maps. Unfortunately, I don't have any experience with Bing maps.

Here's some links to the Google maps API, code samples they provide, and demos.

Let me know if you have any questions about what I described, it may be a little vague.

这篇关于JavaScript用户界面,理想的Bing地图或谷歌地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆