本文整理汇总了TypeScript中proj4.defs函数的典型用法代码示例。如果您正苦于以下问题:TypeScript defs函数的具体用法?TypeScript defs怎么用?TypeScript defs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了defs函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
}
);
const crs3 = new L.Proj.CRS('EPSG:3006',
'+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
origin: [218128.7031, 6126002.9379],
resolutions: [8192, 4096, 2048],
scales: [1, 2],
bounds: new L.Bounds([[1, 2], [3, 4]]),
transformation: new L.Transformation(1, 2, 3, 4),
}
);
// geoJson
proj4.defs("urn:ogc:def:crs:EPSG::26915", "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs");
const geojson = {
type: "Feature",
geometry: {
type: "Point",
coordinates: [481650, 4980105]
},
crs: {
type: "name",
properties: {
name: "urn:ogc:def:crs:EPSG::26915"
}
}
};
示例2: proj4
const point1 = [-71, 41]
const point2 = {x: 2, y: 5}
const mgrs = "24XWT783908"
///////////////////////////////////////////
// Tests Measurement
///////////////////////////////////////////
proj4(epsg['4269'], epsg['4326'], point1)
proj4(epsg['4269'], point1)
proj4(epsg['4269'], epsg['4326']).forward(point2)
proj4(epsg['4269'], epsg['4326']).inverse(point2)
///////////////////////////////////
// Named Projections
///////////////////////////////////
proj4.defs('WGS84', epsg['4326'])
proj4.defs([
['EPSG:4326', epsg['4326']],
['EPSG:4269', epsg['4269']]
])
proj4.defs('urn:x-ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326'))
///////////////////////////////////
// Utils
///////////////////////////////////
// WGS84
proj4.WGS84
// Proj
proj4.Proj('WGS84')
示例3:
IConnection,
IDiva,
IMode,
INode,
IPin,
IPlatform,
IStop,
IStopLocation,
ITrip,
PIN_TYPE,
POI_TYPE,
} from "./interfaces";
// EPSG:31468
proj4.defs(
"GK4",
"+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"
);
// EPSG:3857
proj4.defs(
"WM",
"+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
);
export function WGS84toGK4(lng: number, lat: number): coord {
return proj4("WGS84", "GK4", [lng, lat]).map(Math.round);
}
export function WGS84toWm(lng: number, lat: number): coord {
return proj4("WGS84", "WM", [lng, lat]).map(Math.round);
}