小编Pie*_*ger的帖子

Google地图多重叠加无累积不透明度

我有一张地图上有多个圆圈相互交叉(下面是一个只有两个圆圈的例子,但至少有100个圆圈).当它们交叉时,不透明度加倍,所以当我有一个5或6个圆圈之间的交叉时,它只会变成大约100%的不透明度.

有没有办法让第二个圆圈不显示"第一个圆圈"?实际上一个人不这么认为,但也许有人已经预料到这样的事......

左:我有什么--------------------------------------------- - 对:我想要的 左:我有什么,对:我想要的

以防万一你想玩:http: //jsfiddle.net/ZWt6w/

var populationOptions = {
      strokeWeight: 0,
      fillColor: '#FF0000',
      fillOpacity: 0.5,
      map: map,
      center: citymap[city].center,
      radius: citymap[city].population
    };
    // Add the circle for this city to the map.
    cityCircle = new google.maps.Circle(populationOptions);
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助 ;)

javascript google-maps google-maps-api-3

8
推荐指数
2
解决办法
2870
查看次数

jQuery.click之前的jQuery.on('click')?

我有一个外部脚本,我无法修改.这个脚本加载一个按钮,并在其上添加一个jQuery .click ...它以"return false"结束.

我需要在这次点击时触发我自己的代码.当我加载页面时,不存在,所以我需要使用.on('click')来绑定"live".但看起来.on('click')在".click之后"加载,并且当他使用"return false"时,我的.on('click')没有被加载.

所以问题是......如何触发我点击这个动态加载的#btn已经有一个.click函数返回false?

这是小提琴:http: //jsfiddle.net/PLpqU/

这里有一个代码示例:

<div id="container"></div>
Run Code Online (Sandbox Code Playgroud)
// I want this action to be executed on click, and the other too
// I can't use .click because on the "real" code, the a#btn is loaded after the page by another script
jQuery(document).on('click','a#btn',function(){
        ga('send', 'event', { eventCategory: 'xxxx', eventAction: 'yyyy' });
}) ;

// http://www.xxxxxx.com/distant-script.js
// This one is binded in a script that i cannot edit :
// Just before it load a#btn …
Run Code Online (Sandbox Code Playgroud)

javascript jquery analytics

6
推荐指数
1
解决办法
3万
查看次数