I'm very new to OpenLayers and all the GIS world.
I'm working with rasters (tiff that are converted to postgis sql)
I have this code:
var feature;
$.ajax({
method: "POST",
url: Routing.generate("getdpageometry"),
dataType: 'json',
data: { tipodpa:tipodpa, dpaid:object.id },
async: false
}).done(function( obj ) {
feature = obj.feature;
}.bind(this));
var formatWKT = new ol.format.WKT();
var extentFeature = formatWKT.readFeature(object.extent, {
dataProjection: 'EPSG:3857',
featureProjection: 'EPSG:3857'
});
var formatGeoJSON = new ol.format.GeoJSON();
var feature = formatGeoJSON.readFeature(feature, {
dataProjection: 'EPSG:32719',
featureProjection: 'EPSG:32719'
});
feature.getGeometry().transform('EPSG:32719','EPSG:3857');
Store.vectorSource.clear();
Store.vectorSource.addFeature( feature );
Store.map.getView().fit(extentFeature.getGeometry().getExtent(), Store.map.getSize());
This is part of a code that is showing a map but only a region (defined by an extent in the database) is colored, and adds some blue border to it, like this:
What I need to do is change that blue color, I need it transparent, I only need the border to be blue, and also I would like to change the border color too, so my question is:
Where should I be looking to change those colors?
I'm pretty confused, not sure if it's possible to change it like a parameter, or it's OL3 library default color (I've search into the code, I have changed some blue code colors but nothing happens), or it has to be related with the raster from the database, or where/how...
Using the chosen answer, now my code has:
this.state.vectorLayer = new ol.layer.Vector({
source: this.state.vectorSource,
style: new ol.style.Style({
fill: new ol.style.Fill({ color: 'rgba(0, 0, 0, 0.2)' }),
stroke: new ol.style.Stroke({ color: '#FF0000', width: 2 }),
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({
color: '#ffcc33'
})
})
})
});
And the map: