0
はどのように私はプログラム的にJavaScriptで彼らは私が小さい地物をクリックしたこの写真では、重複機能のためGoogleは、
に重なったときに互いの上にある機能を定義しますためしかし、情報をマップします外側の地理的特徴が浮かび上がった。私はプログラム的に小さいフィーチャーを上に置きたいと思っています。ここで
がjavascript-
map.data.loadGeoJson('<path to my geojson definition>');
map.data.setStyle(function (feature) {
let color = 'gray';
console.log(feature);
if (feature.getProperty('isColorful')) {
color = 'blue';
}
return ({
fillColor: color,
strokeColor: color,
strokeWeight: 1
});
});
map.data.addListener('click', function (event) {
let name = event.feature.getProperty('name');
let contentString = '<h4>Polygon Info</h4><br>';
contentString += '<p>';
if (name) {
contentString += '<b>Name:</b>' + name + '<br>';
}
contentString += '</p>';
let infowindow = new google.maps.InfoWindow({
content: contentString,
position: event.latLng
});
infowindow.open(map);
event.feature.setProperty('isColorful', true);
});
ノートにマップを移入するために私のコードで私はにGeoJSONファイル自体に機能の順序を逆にし、それが動作を変更しませんでした。