Hibajavítás: CoordConverterService
This commit is contained in:
parent
48413ba344
commit
810e118059
@ -14,7 +14,8 @@ Future<void> main() async {
|
||||
anonKey:
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzQwMjY1MjAwLAogICJleHAiOiAxODk4MDMxNjAwCn0.4cMVfAnBLxne1lq0fm94rgtXLBJdRx-0f-E4Jd_jFwI');
|
||||
|
||||
await Get.putAsync(() => CoordConverterService().onInit());
|
||||
await Get.putAsync<CoordConverterService>(
|
||||
() => CoordConverterService().init());
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@ -28,6 +28,25 @@ class CoordConverterService extends GetxService {
|
||||
wgsProj = proj4.Projection.WGS84;
|
||||
}
|
||||
|
||||
Future<CoordConverterService> init() async {
|
||||
final bytes = (await rootBundle.load('assets/Grids/etrs2eov_notowgs.gsb'))
|
||||
.buffer
|
||||
.asUint8List();
|
||||
|
||||
proj4.Projection.nadgrid('Etrs2Eov', bytes);
|
||||
|
||||
const def =
|
||||
'+proj=somerc +lat_0=47.14439372222222 +lon_0=19.04857177777778 '
|
||||
'+k_0=0.99993 +x_0=650000 +y_0=200000 +ellps=GRS67 '
|
||||
'+towgs84=52.17,-71.82,-14.9,0,0,0,0 '
|
||||
'+units=m +nadgrids=Etrs2Eov +no_defs';
|
||||
|
||||
eovProj = proj4.Projection.add('EPSG:23700', def);
|
||||
wgsProj = proj4.Projection.WGS84;
|
||||
|
||||
return this; // ← ez a kulcs
|
||||
}
|
||||
|
||||
// Segédmetódusok — nem kötelező, de tisztább
|
||||
proj4.Point wgsToEovPoint(double lon, double lat) =>
|
||||
wgsProj.transform(eovProj, proj4.Point(x: lon, y: lat));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user