Yii::app()->clientScript->registerScript('search-result', " // var count ='" . $i . "'; // alert(count); $('#map').gmap3({ map:{ options:{ center:" . $center . " zoom: 15 } }, marker:{ values:[ " . $location . " ], cluster:{ radius:30, 0: { content: "<div class='cluster cluster-1'>CLUSTER_COUNT</div>", width: 13, height: 12 }, 10: { width: 26, height: 25 }, 20: { width: 36, height: 35 } }, options:{ draggable: false }, events:{ mouseover: function(marker, event, context){ var map = $(this).gmap3('get'), infowindow = $(this).gmap3({get:{name:'infowindow'}}); if (infowindow){ infowindow.open(map, marker); infowindow.setContent(context.data); } else { $(this).gmap3({ infowindow:{ anchor:marker, options:{content: context.data} } }); } }, mouseout: function(){ var infowindow = $(this).gmap3({get:{name:'infowindow'}}); if (infowindow){ infowindow.close(); } } } } }); ");
Gmap3というGoogleMapのカスタマイズを行えるAPIがあり、ClusterというマーカーをまとめるプロパティにHTMLタグを渡したいのですが...どうやらタグがシンタックスエラーを吐いているようです。
content: "<div class='cluster cluster-1'>CLUSTER_COUNT</div>"
このcontentの部分でエラーが発生しています。シングルクォーテーションとダブルクォーテーションを逆にしたり、エスケープシーケンスを使ったりしたのですが、どれもダメでした。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。