Add wmts-hidpi branch

This commit is contained in:
ahocevar
2014-03-27 20:46:44 +01:00
parent bd9092199b
commit b3ac1afd00
1715 changed files with 784229 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
});
var vector = new ol.layer.Vector({
source: new ol.source.GeoJSON({
projection: 'EPSG:3857',
url: 'data/geojson/countries.geojson'
})
});
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 map = new ol.Map({
interactions: ol.interaction.defaults().extend([select]),
layers: [raster, vector],
renderer: 'canvas',
target: 'map',
view: new ol.View2D({
center: [0, 0],
zoom: 2
})
});