Show how to use a custom style for DragZoom
This commit is contained in:
@@ -5,11 +5,24 @@ goog.require('ol.interaction');
|
||||
goog.require('ol.interaction.DragZoom');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
interactions: ol.interaction.defaults().extend([
|
||||
new ol.interaction.DragZoom()
|
||||
new ol.interaction.DragZoom({
|
||||
style: new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(255,0,0,1)',
|
||||
width: 2
|
||||
}),
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(155,0,0,0.2)'
|
||||
})
|
||||
})
|
||||
})
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
|
||||
Reference in New Issue
Block a user