map.on('click', 'off-leash-areas', function (e) { var coordinates =
e.features[0].geometry.coordinates.slice(); var description =
e.features[0].properties.compname; var inpormasyon =
e.features[0].properties.inpormasyon; var datapogi =
e.features[0].properties.datapogi;
document.getElementById('features').innerHTML = '<br /><br
/><b><input name="station" id="station"
value="'+description+'"/></b><br />'+inpormasyon+'Chart <div
id="container"></div>'; var chart =
anychart.column(datapogi);//--->this one is not changing the values,
cant interpret the new value assigned.
chart.title(datapogi);//but this line appeared instantly on the graph
chart.container("container").draw(chart);
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) { coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360; }
new mapboxgl.Popup() .setLngLat(coordinates) .setHTML('<strong>'+description+'</strong><br />'+inpormasyon)
.addTo(map);
});
// Change the cursor to a pointer when the mouse is over the places layer. map.on('mouseenter', 'places', function () {
map.getCanvas().style.cursor = 'pointer'; });
map.on('mouseleave', 'places', function () { map.getCanvas().style.cursor = '';
});
});
map.on('click', 'off-leash-areas', function (e) {
var coordinates = e.features[0].geometry.coordinates.slice(); var description = e.features[0].properties.compname; var
inpormasyon = e.features[0].properties.inpormasyon; var datapogi =
e.features[0].properties.datapogi;
document.getElementById('features').innerHTML = '<br /><br
/><b><input name="station" id="station"
value="'+description+'"/></b><br />'+inpormasyon+'Chart <div
id="container"></div>'; var chart = anychart.column(datapogi);
chart.title(datapogi);
chart.container("container").draw(chart);
如果单击该测站,则该测站的属性值应该显示在图形中,但没有条形图出现。