Now, let's reuse the previous example and discover more.
Start by copying
2360_08_01_simple_select.html
in a new file called2360_08_02_select_options.html
.After the
vectorEuropa
declaration, add the following JavaScript code to create the vector layer for points. A new dataset, a GeoJSON filefrance_4326.geojson
, is available on the book's webpage:var defaultFrancePoints = new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: 'blue' }), stroke: new ol.style.Stroke({ color: '#ffcc00' }), radius: 8 }) }); var selectFrancePoints = new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#ff0000' }), stroke: new ol.style.Stroke({ color: '#ffccff' }), radius: 16 }) }); var vectorFrancePoints = new ol.layer.Vector({ id: 'france', source: new ol.source.GeoJSON({ projection: 'EPSG:3857', url: '../assets...