问题描述
我已经使用了goMap jQuery插件谷歌地图图钉一些容易和简单的编程配售;我要建立一个网站,但是,在不同的地方类别同时显示,我想通过使每个组/类别不同的颜色视觉上区分它们。
I have used the goMap jQuery plugin for some easy and simple programmatic placing of pushpins on Google maps; I'm going to create a site, though, where various "categories" of places are shown simultaneously, and I want to differentiate them visually by making each group/category a different color.
是任何人意识到无论是如何在goMap完成,或jQuery插件使这可能吗?我没有结婚到谷歌地图; Bing地图将被罚款了。
Is anybody aware of either how this can be done in goMap, or which jQuery plugin makes it possible? I'm not married to Google maps; Bing maps would be fine, too.
推荐答案
这似乎有两个很好的possibilites。一种是使用gmaps.js(),它允许您指定像这样一种颜色(第三下方添加了三个标记)的:
It seems there are two good possibilites. One is to use gmaps.js (http://hpneo.github.io/gmaps/examples/static_markers.html) which lets you specify a color like so (in the third of the three markers added below):
url = GMaps.staticMapURL({
size: [610, 300],
lat: -12.043333,
lng: -77.028333,
markers: [
{lat: -12.043333, lng: -77.028333},
{lat: -12.045333, lng: -77.034, size: 'small'},
{lat: -12.045633, lng: -77.022, color: 'blue'}
]
});
-
和另一种是goMaps,我已经使用,它具有可以设置为.png文件的图标属性。这个例子可以看这里:
使用这种code的:and the other is goMaps, which I've already used, which has an icon property you can set to a .png file. The example can be seen here: http://www.pittss.lv/jquery/gomap/examples/marker_multi.phpusing this sort of code:
$(函数(){
$(#图)。goMap({
标记:[{搜索
纬度:56.948813,
经度:24.704004,
标题:'标记标题1
},{
地址:'莫凯勒米希尔,美国加利福尼亚州,
标题:'标记标题1
},{
纬度:55.548813,
经度:23.204004,
拖动:真实,
图标:../img/drag.png',
HTML:{
内容:'拖我!,
弹出:真
}
}],
图标:../img/apartment.png
});
});$(function() { $("#map").goMap({ markers: [{
latitude: 56.948813, longitude: 24.704004, title: 'marker title 1' },{ address: 'Mokelumne Hill, California, USA', title: 'marker title 1' },{ latitude: 55.548813, longitude: 23.204004, draggable: true, icon: '../img/drag.png', html: { content: 'drag me!', popup:true } }], icon: '../img/apartment.png' }); });现在我有一个单独的问题,但是,对于如何使用图钉图像的spriteful(How我可以使用精灵来指定图钉PNG我想在地图中使用?)
Now I have a separate question, though, regarding how to use a spriteful of pushpin images (How can I use a sprite to specify the pushpin png I want to use in a map?)
这篇关于什么地图的jQuery插件允许指定图钉的颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!