I try to display several layers in own projections on base map also in it's own projection
Below my working example implemented using OpenLayers + proj4 library
var projection_name = 'EPSG:32610';
proj4.defs(projection_name, "+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs");
var proj = ol.proj.get(projection_name);
var my_custom_layer = new ol.layer.Tile({
opacity: 0.5,
source: new ol.source.XYZ({
url: '',
projection: proj,
})
});
var osm_layer = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'}),
opacity: 0.3
});
with OpenLayers I can create something like this
var map = new ol.Map({
layers: [osm_layer, my_custom_layer],
target: 'map',
view: new ol.View({
projection: 'EPSG:4326',
center: [-122.347, 37.805],
zoom: 9
})
});
And as result will be rendered map in projection 4326 and layer in another projection (epsg:32610).
Each tile of my_custom_layer will be transformed its figure to fit for base map projection.
So my tile server every time returns simple square (256x256) tile and OL will transform square to some new figure.
Is it possible to implement it using Leaflet + Proj4Leaflet?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…