"The explosive growth of the GeoWeb and geographic information has made GIS powerful media for the general public to communicate, but perhaps more importantly, GIS have also become media for constructive dialogs and interactions about social issues." - Sui & Goodchild
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
geoinf18:oltuto3 [2018/12/07 15:28] oertz |
geoinf18:oltuto3 [2019/01/08 17:55] oertz [C. Fonction de style] |
||
---|---|---|---|
Line 397: | Line 397: | ||
</code> | </code> | ||
- | **TODO** | + | **TODO** https://www.mediamaps.ch/oltuto/Ex7c-1.html https://www.mediamaps.ch/oltuto/Ex7c-2.html https://www.mediamaps.ch/oltuto/Ex7c-3.html |
- Modifier ce qu'il faut pour visualiser des étiquettes comme suit __Gollum says: The precious is here!__ et __Gandalf says: The hobbits are far away...__ | - Modifier ce qu'il faut pour visualiser des étiquettes comme suit __Gollum says: The precious is here!__ et __Gandalf says: The hobbits are far away...__ | ||
- | - Ajouter une couche vector utilisant le flux https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson et faire en sorte que les points séismes soient représentés différemment dans chaque hémisphère. | + | - Ajouter une couche vector utilisant le flux https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson et faire en sorte que les points séismes soient représentés différemment dans chaque hémisphère.<code> |
+ | function createQuakeStyle(feature, resolution) { | ||
+ | var quakeStyleS = new ol.style.Style({ | ||
+ | image: new ol.style.Circle({ | ||
+ | radius: 5, | ||
+ | fill: new ol.style.Fill({ | ||
+ | color: '#ff0000' | ||
+ | }) | ||
+ | }) | ||
+ | }); | ||
+ | |||
+ | var quakeStyleN = new ol.style.Style({ | ||
+ | image: new ol.style.Circle({ | ||
+ | radius: 5, | ||
+ | fill: new ol.style.Fill({ | ||
+ | color: '#0000ff' | ||
+ | }) | ||
+ | }) | ||
+ | }); | ||
+ | |||
+ | coords = feature.getGeometry().getCoordinates(); | ||
+ | console.log(coords); | ||
+ | |||
+ | if (coords[1] < 0) | ||
+ | quakeStyle = quakeStyleS; | ||
+ | else | ||
+ | quakeStyle = quakeStyleN; | ||
+ | |||
+ | return quakeStyle; | ||
+ | } | ||
+ | </code> | ||
- Sur la base de ce même flux, proposer une représentation thématique des points séismes en exploitant leur propriété d'intensité/magnitude (voir l'attribut ''mag'', voir aussi [[http://fr.wikipedia.org/wiki/Magnitude_d%27un_s%C3%A9isme#.C3.89chelle_de_Richter|Echelle de Richter]]). \\ En quoi le paramètre ''renderOrder'' de [[http://openlayers.org/en/v3.19.1/apidoc/ol.layer.Vector.html|ol.layer.Vector]] est ici particulièrement intéressant ? | - Sur la base de ce même flux, proposer une représentation thématique des points séismes en exploitant leur propriété d'intensité/magnitude (voir l'attribut ''mag'', voir aussi [[http://fr.wikipedia.org/wiki/Magnitude_d%27un_s%C3%A9isme#.C3.89chelle_de_Richter|Echelle de Richter]]). \\ En quoi le paramètre ''renderOrder'' de [[http://openlayers.org/en/v3.19.1/apidoc/ol.layer.Vector.html|ol.layer.Vector]] est ici particulièrement intéressant ? | ||
{{:geoinf15:earthquakes.png?nolink|}} | {{:geoinf15:earthquakes.png?nolink|}} |