Update wmts-hidpi, add nicer-api-docs
This commit is contained in:
@@ -9,40 +9,11 @@ var vector = new ol.layer.Vector({
|
||||
})
|
||||
});
|
||||
|
||||
var styleCache = {};
|
||||
var select = new ol.interaction.Select({
|
||||
style: function(feature, resolution) {
|
||||
var text = feature.get('name');
|
||||
if (!styleCache[text]) {
|
||||
styleCache[text] = [new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,0,0,0.3)'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(255,0,0,1)',
|
||||
size: 2
|
||||
}),
|
||||
text: new ol.style.Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
text: text,
|
||||
fill: new ol.style.Fill({
|
||||
color: '#000'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#fff',
|
||||
width: 3
|
||||
})
|
||||
})
|
||||
})];
|
||||
}
|
||||
return styleCache[text];
|
||||
}
|
||||
});
|
||||
var select = new ol.interaction.Select();
|
||||
|
||||
var map = new ol.Map({
|
||||
interactions: ol.interaction.defaults().extend([select]),
|
||||
layers: [raster, vector],
|
||||
renderer: 'canvas',
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
|
||||
Reference in New Issue
Block a user