Styling multiple WFS with OpenLayers 3

المشرف العام

Administrator
طاقم الإدارة
Been stuck on this one a while. Let me know if you can help.

In the application I am building, I am importing two GeoServer WFS vector layers and trying to set a different style to each of them. Here is what I have right now:

//Adding vector layer for show centersvar NVbuildings = new ol.layer.Vector({ source: buildingSource, style: new ol.style.Style({ image: new ol.style.Circle({ radius: 5, fill: new ol.style.Fill({color: '#FFFFFF'}), stroke: new ol.style.Stroke({ color: '#000000', width: 3 }) }) })});//Adding vector layer for show centersvar centerlocations = new ol.layer.Vector({ source: vectorSource, style: new ol.style.Style({ image: new ol.style.RegularShape({ points: 5, radius1: 10, radius2: 4, angle: 0, fill: new ol.style.Fill({color: '#000000'}), stroke: new ol.style.Stroke({ color: '#000000', width: 3 }) }) })});Currently, the application shows all points from both vectors, but they are both of the same style (the NVbuildings style). I've tried moving things around and changing the RegularShape to Circle, but all points always have the same style. Any suggestions? Thanks



أكثر...
 
أعلى