Published
Edited
Jan 30, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
style_select = function(feature, resolution) {
var context = {
feature: feature,
variables: {}
};
var size = 0;

console.log(feature);
if (feature.get("features")) {
console.log("ok");
size = feature.get("features").length;
if (size > 1) {
size = 2 * (Math.log(size) / Math.log(2));
}
console.log(size);
}
//console.log(size);
var style = [
new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'black',
width: 1.4
}),
fill: new ol.style.Fill({ color: 'rgba(255,255,255,0.5)' })
}),
new ol.style.Style({
image: new ol.style.Circle({
color: 'rgba(228,26,28,1.0)',
radius: 4 + size,
fill: new ol.style.Fill({
color: 'rgba(255,255,255,0.5)'
}),
stroke: new ol.style.Stroke({
color: 'black',
width: 1.4
})
}),
zIndex: Infinity
})
];

return style;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("https://d3js.org/d3.v6.min.js")
Insert cell
Insert cell
html`<div class="border border-danger" title="montitre" data-toggle="tooltip">allo</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>`
Insert cell
{
document.head.appendChild(
html`<link href='https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css'
)}' rel='stylesheet' />`
);
}
Insert cell
Insert cell
bs = require("bootstrap@4.5.0")
Insert cell
topojson = require("https://unpkg.com/topojson@3.0.2/dist/topojson.js")
Insert cell
po = require("popper.js@1.16.0")
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more