I tried adding an SVG as a layer on my map but it does not show up.
//For registering EPSG: 2326
import * as proj4x from 'proj4';
var proj4 = (proj4x as any).default;
import {register} from 'ol/proj/proj4';
proj4.defs('EPSG:2326', '+proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +units=m +no_defs');
register(proj4);
var projection2326 = get('EPSG:2326');
var extentTest = [815366.7950903749, 818259.401599934, 815684.9262746248,825970.8994440462 ];
var projectionTest = new Projection({
code: 'EPSG:2326',
units: 'm',
extent: this.map.getView().calculateExtent(this.map.getSize())
});
var SVGLayer = new ImageLayer({
source: new Static({
url: 'assets/SvgFile.svg',
projection: projectionTest,
imageExtent: extentTest
})
});
this.map.addLayer(SVGLayer);
Am i writing the extent wrong ? The drawing does not show up on the map at all.