@baidumap/mapv-three 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/images/markers/mkr_end.png +0 -0
- package/dist/assets/images/markers/mkr_red_1.png +0 -0
- package/dist/assets/images/markers/mkr_red_10.png +0 -0
- package/dist/assets/images/markers/mkr_red_2.png +0 -0
- package/dist/assets/images/markers/mkr_red_3.png +0 -0
- package/dist/assets/images/markers/mkr_red_4.png +0 -0
- package/dist/assets/images/markers/mkr_red_5.png +0 -0
- package/dist/assets/images/markers/mkr_red_6.png +0 -0
- package/dist/assets/images/markers/mkr_red_7.png +0 -0
- package/dist/assets/images/markers/mkr_red_8.png +0 -0
- package/dist/assets/images/markers/mkr_red_9.png +0 -0
- package/dist/assets/images/markers/mkr_start.png +0 -0
- package/dist/assets/images/markers/mkr_transit_airplane.png +0 -0
- package/dist/assets/images/markers/mkr_transit_bus.png +0 -0
- package/dist/assets/images/markers/mkr_transit_car.png +0 -0
- package/dist/assets/images/markers/mkr_transit_subway.png +0 -0
- package/dist/assets/images/markers/mkr_transit_train.png +0 -0
- package/dist/assets/images/markers/mkr_transit_walking.png +0 -0
- package/dist/assets/images/markers/mkr_waypoint.png +0 -0
- package/dist/assets/textures/roadpile/blue.png +0 -0
- package/dist/assets/textures/roadpile/brown.png +0 -0
- package/dist/assets/textures/roadpile/green.png +0 -0
- package/dist/mapvthree.module.js +20942 -18540
- package/dist/mapvthree.umd.js +6 -6
- package/dist/types/index.d.ts +2 -8
- package/dist/types/index.open.d.ts +1 -0
- package/dist/types/threejs/materials/natural/WaterMaterial.d.ts +3 -0
- package/dist/types/threejs/materials/point/Icon.d.ts +1 -0
- package/dist/types/threejs/objects/point/Label.d.ts +3 -0
- package/dist/types/threejs/objects/polygon/Polygon.d.ts +37 -0
- package/dist/types/threemap/3dtiles/cesium/Cesium3DTileset.d.ts +5 -0
- package/dist/types/threemap/3dtiles/elements/TileInstancedElementManager.d.ts +98 -0
- package/dist/types/threemap/engine/Rendering.d.ts +0 -2
- package/dist/types/threemap/mapView/configs.d.ts +6 -1
- package/dist/types/threemap/mapView/tileProvider/imagery/Baidu09ImageryTileProvider.d.ts +1 -1
- package/dist/types/threemap/mapView/tileProvider/imagery/TiandituImageryTileProvider.d.ts +1 -1
- package/dist/types/threemap/mapView/tileProvider/imagery/XYZImageryTileProvider.d.ts +1 -1
- package/dist/types/threemap/overlay/DOMOverlay.d.ts +9 -2
- package/dist/types/threemap/overlay/Marker.d.ts +2 -2
- package/dist/types/threemap/services/autoComplete/AutoComplete.d.ts +147 -0
- package/dist/types/threemap/services/autoComplete/AutoComplete_Bd.d.ts +154 -0
- package/dist/types/threemap/services/boundary/Boundary.d.ts +69 -0
- package/dist/types/threemap/services/boundary/Boundary_Bd.d.ts +56 -0
- package/dist/types/threemap/services/boundary/Boundary_Tdt.d.ts +17 -0
- package/dist/types/threemap/services/common/baiduCommon.d.ts +136 -0
- package/dist/types/threemap/services/common/baiduRequest.d.ts +3 -0
- package/dist/types/threemap/services/common/baiduUtils.d.ts +13 -0
- package/dist/types/threemap/services/common/tdtRequest.d.ts +34 -0
- package/dist/types/threemap/services/configs.d.ts +10 -0
- package/dist/types/threemap/services/constants.d.ts +8 -0
- package/dist/types/threemap/services/district/DistrictLayer.d.ts +167 -0
- package/dist/types/threemap/services/district/DistrictLayer_Bd.d.ts +41 -0
- package/dist/types/threemap/services/district/DistrictLayer_Tdt.d.ts +47 -0
- package/dist/types/threemap/services/geocoder/Geocoder.d.ts +100 -0
- package/dist/types/threemap/services/geocoder/Geocoder_Bd.d.ts +24 -0
- package/dist/types/threemap/services/geocoder/Geocoder_Tdt.d.ts +10 -0
- package/dist/types/threemap/services/index.d.ts +11 -0
- package/dist/types/threemap/services/localSearch/LocalResult.d.ts +47 -0
- package/dist/types/threemap/services/localSearch/LocalSearch.d.ts +175 -0
- package/dist/types/threemap/services/localSearch/LocalSearch_Bd.d.ts +18 -0
- package/dist/types/threemap/services/localSearch/LocalSearch_Tdt.d.ts +6 -0
- package/dist/types/threemap/services/routeSearch/BaseRoute.d.ts +113 -0
- package/dist/types/threemap/services/routeSearch/DWRoute_Bd.d.ts +46 -0
- package/dist/types/threemap/services/routeSearch/DWRoute_Tdt.d.ts +8 -0
- package/dist/types/threemap/services/routeSearch/DrivingRoute.d.ts +113 -0
- package/dist/types/threemap/services/routeSearch/RidingRoute.d.ts +63 -0
- package/dist/types/threemap/services/routeSearch/RouteResult.d.ts +39 -0
- package/dist/types/threemap/services/routeSearch/TransitRoute.d.ts +111 -0
- package/dist/types/threemap/services/routeSearch/TransitRoute_Bd.d.ts +33 -0
- package/dist/types/threemap/services/routeSearch/TransitRoute_Tdt.d.ts +9 -0
- package/dist/types/threemap/services/routeSearch/WalkingRoute.d.ts +69 -0
- package/package.json +1 -1
- package/dist/assets/textures/building/1024/Level12_Repeat0_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat0_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat0_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat0_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat3_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat3_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat3_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level12_Repeat3_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level18_Repeat3_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level18_Repeat3_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level18_Repeat3_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level18_Repeat3_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level1_Repeat0_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level1_Repeat0_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level1_Repeat0_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level1_Repeat0_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat0_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat0_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat0_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat0_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat3_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat3_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat3_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level23_Repeat3_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level2_Repeat1_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level2_Repeat1_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level2_Repeat1_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level2_Repeat1_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat1_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat1_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat1_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat1_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat2_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat2_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat2_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level3_Repeat2_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level4_Repeat3_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level4_Repeat3_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level4_Repeat3_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level4_Repeat3_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level6_Repeat3_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level6_Repeat3_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level6_Repeat3_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level6_Repeat3_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level7_Repeat3_RR1_Grid8_0_LOD0_Res1024_DiffuseMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level7_Repeat3_RR1_Grid8_0_LOD0_Res1024_EmissiveMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level7_Repeat3_RR1_Grid8_0_LOD0_Res1024_NormalMap.PNG +0 -0
- package/dist/assets/textures/building/1024/Level7_Repeat3_RR1_Grid8_0_LOD0_Res1024_RoughnessMap.PNG +0 -0
- package/dist/assets/textures/building/ac1.png +0 -0
- package/dist/assets/textures/building/black.png +0 -0
- package/dist/assets/textures/building/buiding_normal.jpg +0 -0
- package/dist/assets/textures/building/buiding_roughness.jpg +0 -0
- package/dist/assets/textures/building/building2_atlas_diffuse.jpg +0 -0
- package/dist/assets/textures/building/building2_atlas_diffuse_debug.jpg +0 -0
- package/dist/assets/textures/building/building3_atlas_diffuse.jpg +0 -0
- package/dist/assets/textures/building/building3_atlas_metallic_roughness.jpg +0 -0
- package/dist/assets/textures/building/building3_atlas_normal.jpg +0 -0
- package/dist/assets/textures/building/building4_diffuse.jpg +0 -0
- package/dist/assets/textures/building/building_atlas_diffuse.jpg +0 -0
- package/dist/assets/textures/building/building_atlas_emissive.jpg +0 -0
- package/dist/assets/textures/building/building_atlas_metallic_roughness.jpg +0 -0
- package/dist/assets/textures/building/building_atlas_normal.jpg +0 -0
- package/dist/assets/textures/building/building_atlas_roughness.jpg +0 -0
- package/dist/assets/textures/building/building_diffuse.jpg +0 -0
- package/dist/assets/textures/building/building_side.jpg +0 -0
- package/dist/assets/textures/realistic/Albedo_2K_vl1lfb3fw_512.jpg +0 -0
- package/dist/assets/textures/realistic/Albedo_2K_xdhhdhl_512.jpg +0 -0
- package/dist/assets/textures/realistic/Grass_1_S.jpg +0 -0
- package/dist/assets/textures/realistic/Green_dark.jpg +0 -0
- package/dist/assets/textures/realistic/Road.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_10_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_10_ao.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_10_height.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_10_normal.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_10_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_albedo.tif +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_ao.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_ao.tif +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_height.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_height.tif +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_normal.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_normal.tif +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/Road_Asphalt_roughness.tif +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Asphalt_Base10_2x2_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Asphalt_Base10_2x2_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Asphalt_Base10_2x2_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Asphalt_Base10_2x2_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Asphalt_Base10_2x2_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Concrete_WW2_2x2_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Concrete_WW2_2x2_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Concrete_WW2_2x2_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Green_Default_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Greenbelt_Default_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Ground_RockBed4_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Ground_RockBed4_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Ground_RockBed4_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Ground_RockBed4_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Ground_RockBed4_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Moss_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Moss_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Moss_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Moss_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Moss_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Pebbles_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Pebbles_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Pebbles_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Pebbles_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Nature_Pebbles_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Road_Bitumen_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Road_Bitumen_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Road_Bitumen_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Road_Bitumen_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Road_Bitumen_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Road_Default_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Roofing_Bitumen_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Roofing_Bitumen_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Roofing_Bitumen_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Roofing_Bitumen_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Roofing_Bitumen_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_emissive.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_metallic.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise4_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise5_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise5_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise5_512_emissive.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise5_512_metallic.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise5_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise5_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_albedo.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_ao.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_emissive.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_height.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_metallic.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_normal.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise6_512_roughness.jpg +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise_512_albedo.png +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise_512_ao.png +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise_512_emissive.png +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise_512_normal.png +0 -0
- package/dist/assets/textures/realistic/TexturesCom_Various_HighRise_512_roughness.png +0 -0
- package/dist/types/threemap/controls/measure/CurvatureMeasure.d.ts +0 -7
- package/dist/types/threemap/controls/measure/SlopeMeasure.d.ts +0 -49
- package/dist/types/threemap/services/CurvatureService.d.ts +0 -18
- package/dist/types/threemap/services/GeoCombinedService.d.ts +0 -13
- package/dist/types/threemap/services/PoiService.d.ts +0 -39
- package/dist/types/threemap/services/RoadService.d.ts +0 -39
- package/dist/types/threemap/services/RouteService.d.ts +0 -34
- package/dist/types/threemap/services/Service.d.ts +0 -46
- /package/dist/assets/textures/{realistic → weather}/TexturesCom_Ground_MudWet_512_roughness.jpg +0 -0
- /package/dist/assets/textures/{realistic → weather}/TexturesCom_Snow_Plain_3x3_512_height.jpg +0 -0
- /package/dist/assets/textures/{realistic → weather}/TexturesCom_Snow_Plain_3x3_512_noise.jpg +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 地理编码服务
|
|
3
|
+
*
|
|
4
|
+
* 支持以下功能:
|
|
5
|
+
* - 地址转坐标(地理编码)
|
|
6
|
+
* - 坐标转地址(逆地理编码)
|
|
7
|
+
* - 支持百度地图和天地图API
|
|
8
|
+
*
|
|
9
|
+
* @category Services
|
|
10
|
+
* @example
|
|
11
|
+
* ```javascript
|
|
12
|
+
* // 创建百度地图地理编码服务
|
|
13
|
+
* const geocoder = new mapvthree.Services.Geocoder({
|
|
14
|
+
* apiSource: mapvthree.Services.API_SOURCE_BAIDU,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // 地址转坐标
|
|
18
|
+
* geocoder.getPoint('北京市朝阳区', (result) => {
|
|
19
|
+
* console.log('坐标:', result.point);
|
|
20
|
+
* console.log('地址:', result.address);
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* // 创建天地图地理编码服务
|
|
27
|
+
* const geocoder = new mapvthree.Services.Geocoder({
|
|
28
|
+
* apiSource: mapvthree.Services.API_SOURCE_TIANDITU,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // 坐标转地址
|
|
32
|
+
* geocoder.getLocation([116.404, 39.915], (result) => {
|
|
33
|
+
* console.log('地址:', result.address);
|
|
34
|
+
* console.log('坐标:', result.point);
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export class Geocoder {
|
|
39
|
+
/**
|
|
40
|
+
* 创建地理编码服务实例
|
|
41
|
+
* @param {Object} options 配置参数
|
|
42
|
+
* @param {string} [options.apiSource] API数据源。
|
|
43
|
+
* 可以配置为{@link Services.API_SOURCE_BAIDU}或{@link Services.API_SOURCE_TIANDITU},默认使用配置的数据源
|
|
44
|
+
*/
|
|
45
|
+
constructor(options?: {
|
|
46
|
+
apiSource?: string | undefined;
|
|
47
|
+
});
|
|
48
|
+
options: {
|
|
49
|
+
apiSource?: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
apiSource: string;
|
|
52
|
+
_gc: Geocoder_Bd | Geocoder_Tdt;
|
|
53
|
+
/**
|
|
54
|
+
* 创建具体的地理编码实现实例
|
|
55
|
+
* @param {Object} options 配置参数
|
|
56
|
+
* @returns {Geocoder_Bd|Geocoder_Tdt} 具体的实现实例
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private _createInstance;
|
|
60
|
+
/**
|
|
61
|
+
* 地址转坐标(地理编码)
|
|
62
|
+
* @param {string} address 地址字符串
|
|
63
|
+
* @param {Function} callback 回调函数,返回地理编码结果
|
|
64
|
+
* @param {Object} callback.result 地理编码结果
|
|
65
|
+
* @param {Array<number>} callback.result.point 坐标点 [lng, lat]
|
|
66
|
+
* @param {string} callback.result.address 地址信息
|
|
67
|
+
* @param {string} [city] 城市名称,用于限定搜索范围
|
|
68
|
+
* @example
|
|
69
|
+
* ```javascript
|
|
70
|
+
* geocoder.getPoint('北京市朝阳区', (result) => {
|
|
71
|
+
* console.log('坐标:', result.point); // [116.404, 39.915]
|
|
72
|
+
* console.log('地址:', result.address);
|
|
73
|
+
* }, '北京市');
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
getPoint(address: string, callback: Function, city?: string): Promise<any> | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* 坐标转地址(逆地理编码)
|
|
79
|
+
* @param {Array<number>} point 坐标点 [lng, lat]
|
|
80
|
+
* @param {Function} callback 回调函数,返回逆地理编码结果
|
|
81
|
+
* @param {Object} callback.result 逆地理编码结果
|
|
82
|
+
* @param {string} callback.result.address 地址信息
|
|
83
|
+
* @param {Array<number>} callback.result.point 坐标点 [lng, lat]
|
|
84
|
+
* @param {Object} [opts] 额外选项
|
|
85
|
+
* @example
|
|
86
|
+
* ```javascript
|
|
87
|
+
* geocoder.getLocation([116.404, 39.915], (result) => {
|
|
88
|
+
* console.log('地址:', result.address);
|
|
89
|
+
* console.log('坐标:', result.point);
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
getLocation(point: Array<number>, callback: Function, opts?: Object): Promise<{
|
|
94
|
+
address: any;
|
|
95
|
+
addressComponents: any;
|
|
96
|
+
point: any;
|
|
97
|
+
} | null> | undefined;
|
|
98
|
+
}
|
|
99
|
+
import { Geocoder_Bd } from './Geocoder_Bd';
|
|
100
|
+
import { Geocoder_Tdt } from './Geocoder_Tdt';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class Geocoder_Bd {
|
|
2
|
+
constructor(options?: {});
|
|
3
|
+
options: {};
|
|
4
|
+
_baiduMercatorProjection: any;
|
|
5
|
+
getPoint(address: any, callback: any, city: any): Promise<any> | undefined;
|
|
6
|
+
getLocation(point: any, callback: any, opts: any): Promise<{
|
|
7
|
+
point: any;
|
|
8
|
+
address: any;
|
|
9
|
+
addressComponents: {};
|
|
10
|
+
surroundingPois: {
|
|
11
|
+
title: any;
|
|
12
|
+
uid: any;
|
|
13
|
+
point: any;
|
|
14
|
+
city: any;
|
|
15
|
+
_poiType: any;
|
|
16
|
+
type: number;
|
|
17
|
+
address: any;
|
|
18
|
+
postcode: any;
|
|
19
|
+
phoneNumber: any;
|
|
20
|
+
}[];
|
|
21
|
+
business: any;
|
|
22
|
+
content: any;
|
|
23
|
+
} | null> | undefined;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class Geocoder_Tdt {
|
|
2
|
+
constructor(options?: {});
|
|
3
|
+
options: {};
|
|
4
|
+
getPoint(address: any, callback: any, city: any): Promise<any> | undefined;
|
|
5
|
+
getLocation(point: any, callback: any): Promise<{
|
|
6
|
+
address: any;
|
|
7
|
+
addressComponents: any;
|
|
8
|
+
point: any;
|
|
9
|
+
} | null> | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Geocoder } from "./geocoder/Geocoder";
|
|
2
|
+
export { LocalSearch } from "./localSearch/LocalSearch";
|
|
3
|
+
export { AutoComplete } from "./autoComplete/AutoComplete";
|
|
4
|
+
export { Boundary } from "./boundary/Boundary";
|
|
5
|
+
export { DistrictLayer } from "./district/DistrictLayer";
|
|
6
|
+
export { DrivingRoute } from "./routeSearch/DrivingRoute";
|
|
7
|
+
export { RidingRoute } from "./routeSearch/RidingRoute";
|
|
8
|
+
export { TransitRoute } from "./routeSearch/TransitRoute";
|
|
9
|
+
export { WalkingRoute } from "./routeSearch/WalkingRoute";
|
|
10
|
+
export * from "./constants";
|
|
11
|
+
export { setApiSource, getApiSource } from "./configs";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class LocalResult {
|
|
2
|
+
constructor(opts?: {});
|
|
3
|
+
/**
|
|
4
|
+
* 检索关键字
|
|
5
|
+
*/
|
|
6
|
+
keyword: any;
|
|
7
|
+
/**
|
|
8
|
+
* 当前页面索引
|
|
9
|
+
*/
|
|
10
|
+
pageIndex: any;
|
|
11
|
+
/**
|
|
12
|
+
* 当前页面结果数
|
|
13
|
+
*/
|
|
14
|
+
currentNumPois: any;
|
|
15
|
+
/**
|
|
16
|
+
* 总结果数
|
|
17
|
+
*/
|
|
18
|
+
total: any;
|
|
19
|
+
/**
|
|
20
|
+
* 总页数
|
|
21
|
+
*/
|
|
22
|
+
numPages: number;
|
|
23
|
+
/**
|
|
24
|
+
* 中心点(周边检索)
|
|
25
|
+
*/
|
|
26
|
+
center: any;
|
|
27
|
+
/**
|
|
28
|
+
* 半径(周边检索)
|
|
29
|
+
*/
|
|
30
|
+
radius: any;
|
|
31
|
+
/**
|
|
32
|
+
* 范围(范围检索)
|
|
33
|
+
*/
|
|
34
|
+
bounds: any;
|
|
35
|
+
/**
|
|
36
|
+
* 检索结果所在城市
|
|
37
|
+
*/
|
|
38
|
+
city: any;
|
|
39
|
+
/**
|
|
40
|
+
* 检索结果所在省份
|
|
41
|
+
*/
|
|
42
|
+
province: any;
|
|
43
|
+
/**
|
|
44
|
+
* 结果点数组
|
|
45
|
+
*/
|
|
46
|
+
pois: any;
|
|
47
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 本地搜索服务
|
|
3
|
+
*
|
|
4
|
+
* 支持以下功能:
|
|
5
|
+
* - 关键词搜索POI(兴趣点)
|
|
6
|
+
* - 支持百度地图和天地图API
|
|
7
|
+
* - 分页搜索支持
|
|
8
|
+
* - 自动渲染搜索结果到地图
|
|
9
|
+
*
|
|
10
|
+
* @category Services
|
|
11
|
+
* @example
|
|
12
|
+
* ```javascript
|
|
13
|
+
* // 创建百度地图本地搜索服务
|
|
14
|
+
* const localSearch = new mapvthree.Services.LocalSearch({
|
|
15
|
+
* apiSource: mapvthree.Services.API_SOURCE_BAIDU,
|
|
16
|
+
* pageCapacity: 20,
|
|
17
|
+
* renderOptions: {
|
|
18
|
+
* engine: engine,
|
|
19
|
+
* autoViewport: true,
|
|
20
|
+
* },
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // 搜索餐厅
|
|
24
|
+
* localSearch.search('餐厅', {
|
|
25
|
+
* pageNum: 0,
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```javascript
|
|
31
|
+
* // 创建天地图本地搜索服务
|
|
32
|
+
* const localSearch = new mapvthree.Services.LocalSearch({
|
|
33
|
+
* apiSource: mapvthree.Services.API_SOURCE_TIANDITU,
|
|
34
|
+
* pageCapacity: 10,
|
|
35
|
+
* renderOptions: {
|
|
36
|
+
* engine: engine,
|
|
37
|
+
* autoViewport: false,
|
|
38
|
+
* },
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // 搜索酒店
|
|
42
|
+
* const result = await localSearch.search('酒店');
|
|
43
|
+
* console.log('搜索结果:', result.pois);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export class LocalSearch {
|
|
47
|
+
static DEFAULT_PAGE_CAPACITY: number;
|
|
48
|
+
static MIN_PAGE_CAPACITY: number;
|
|
49
|
+
static MAX_PAGE_CAPACITY: number;
|
|
50
|
+
static DEFAULT_RADIUS: number;
|
|
51
|
+
static MAX_RADIUS: number;
|
|
52
|
+
static DEFAULT_PAGE_NUM: number;
|
|
53
|
+
/**
|
|
54
|
+
* 创建本地搜索服务实例
|
|
55
|
+
* @param {Object} options 配置参数
|
|
56
|
+
* @param {number} [options.pageCapacity=10] 每页结果数,默认10
|
|
57
|
+
* @param {number} [options.pageNum=0] 页码,默认0
|
|
58
|
+
* @param {string} [options.apiSource] API数据源。
|
|
59
|
+
* 可以配置为{@link Services.API_SOURCE_BAIDU}或{@link Services.API_SOURCE_TIANDITU},默认使用配置的数据源
|
|
60
|
+
* @param {Object} [options.renderOptions] 渲染配置
|
|
61
|
+
* @param {Engine} options.renderOptions.engine 地图引擎实例
|
|
62
|
+
* @param {boolean} [options.renderOptions.autoViewport=true] 是否自动调整地图视图以包含所有搜索结果
|
|
63
|
+
*/
|
|
64
|
+
constructor(options?: {
|
|
65
|
+
pageCapacity?: number | undefined;
|
|
66
|
+
pageNum?: number | undefined;
|
|
67
|
+
apiSource?: string | undefined;
|
|
68
|
+
renderOptions?: {
|
|
69
|
+
engine: Engine;
|
|
70
|
+
autoViewport?: boolean | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
});
|
|
73
|
+
result: null;
|
|
74
|
+
_markers: any[];
|
|
75
|
+
_popup: null;
|
|
76
|
+
options: {
|
|
77
|
+
pageCapacity?: number | undefined;
|
|
78
|
+
pageNum?: number | undefined;
|
|
79
|
+
apiSource?: string | undefined;
|
|
80
|
+
renderOptions?: {
|
|
81
|
+
engine: Engine;
|
|
82
|
+
autoViewport?: boolean | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
};
|
|
85
|
+
apiSource: string;
|
|
86
|
+
_local: any;
|
|
87
|
+
_engine: any;
|
|
88
|
+
_createInstance(options: any): any;
|
|
89
|
+
/**
|
|
90
|
+
* 搜索POI(兴趣点)
|
|
91
|
+
* @param {string} keyword 搜索关键词
|
|
92
|
+
* @param {Object} [opts={}] 搜索选项
|
|
93
|
+
* @param {number} [opts.pageCapacity] 每页结果数
|
|
94
|
+
* @param {number} [opts.pageNum] 页码
|
|
95
|
+
* @returns {Promise<Object>} 搜索结果
|
|
96
|
+
* @param {Array<Object>} result.pois POI列表
|
|
97
|
+
* @param {Array<number>} result.pois[].point POI坐标 [lng, lat]
|
|
98
|
+
* @param {string} result.pois[].title POI标题
|
|
99
|
+
* @param {string} result.pois[].address POI地址
|
|
100
|
+
* @example
|
|
101
|
+
* ```javascript
|
|
102
|
+
* const result = await localSearch.search('餐厅', {
|
|
103
|
+
* pageCapacity: 20,
|
|
104
|
+
* pageNum: 0,
|
|
105
|
+
* });
|
|
106
|
+
* console.log('找到', result.pois.length, '个餐厅');
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
search(keyword: string, opts?: {
|
|
110
|
+
pageCapacity?: number | undefined;
|
|
111
|
+
pageNum?: number | undefined;
|
|
112
|
+
}): Promise<Object>;
|
|
113
|
+
/**
|
|
114
|
+
* 跳转到指定页码
|
|
115
|
+
* @param {number} pageNum 页码
|
|
116
|
+
*/
|
|
117
|
+
gotoPage(pageNum: number): void;
|
|
118
|
+
/**
|
|
119
|
+
* 渲染搜索结果到地图
|
|
120
|
+
* @param {Object} result 搜索结果
|
|
121
|
+
* @param {Array<Object>} result.pois POI列表
|
|
122
|
+
* @private
|
|
123
|
+
*/
|
|
124
|
+
private renderMap;
|
|
125
|
+
/**
|
|
126
|
+
* 设置在索引为index的标注点处显示弹窗
|
|
127
|
+
* @param {number} index 索引
|
|
128
|
+
*/
|
|
129
|
+
setPopupByIndex(index: number): void;
|
|
130
|
+
clearMap(): void;
|
|
131
|
+
/**
|
|
132
|
+
* 设置检索结果每页容量
|
|
133
|
+
* @param {number} cap 每页容量,支持1-100
|
|
134
|
+
* @example
|
|
135
|
+
* ```javascript
|
|
136
|
+
* localSearch.setPageCapacity(20); // 设置每页显示20个结果
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
setPageCapacity(cap: number): void;
|
|
140
|
+
/**
|
|
141
|
+
* 获取当前每页容量
|
|
142
|
+
* @returns {number} 每页容量
|
|
143
|
+
* @example
|
|
144
|
+
* ```javascript
|
|
145
|
+
* const capacity = localSearch.getPageCapacity();
|
|
146
|
+
* console.log('当前每页容量:', capacity);
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
getPageCapacity(): number;
|
|
150
|
+
/**
|
|
151
|
+
* 设置页码
|
|
152
|
+
* @param {number} num 页码,从0开始
|
|
153
|
+
* @example
|
|
154
|
+
* ```javascript
|
|
155
|
+
* localSearch.setPageNum(1); // 设置第2页
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
setPageNum(num: number): void;
|
|
159
|
+
/**
|
|
160
|
+
* 获取当前页码
|
|
161
|
+
* @returns {number} 当前页码
|
|
162
|
+
* @example
|
|
163
|
+
* ```javascript
|
|
164
|
+
* const pageNum = localSearch.getPageNum();
|
|
165
|
+
* console.log('当前页码:', pageNum);
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
getPageNum(): number;
|
|
169
|
+
/**
|
|
170
|
+
* 获取搜索结果
|
|
171
|
+
* @returns {Object} 搜索结果
|
|
172
|
+
*/
|
|
173
|
+
getResult(): Object;
|
|
174
|
+
clearResult(): void;
|
|
175
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class LocalSearch_Bd {
|
|
2
|
+
constructor(options?: {});
|
|
3
|
+
options: {};
|
|
4
|
+
_baiduMercatorProjection: any;
|
|
5
|
+
search(keyword: any, opts: any): Promise<LocalResult | undefined>;
|
|
6
|
+
/**
|
|
7
|
+
* 验证请求类型是否与返回的数据匹配
|
|
8
|
+
* @param {String} 请求类型qt
|
|
9
|
+
* @param {Number} 返回类型type
|
|
10
|
+
* @returns {Boolean} 是否匹配
|
|
11
|
+
*/
|
|
12
|
+
_isReqDataMap: (qt: any, type: any) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 根据poi类型格式化地址字段,其中地铁站和公交站的线路要去重
|
|
15
|
+
*/
|
|
16
|
+
_formatAddr: (addr: any, poiType: any) => any;
|
|
17
|
+
}
|
|
18
|
+
import { LocalResult } from './LocalResult';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 路线规划服务基类
|
|
3
|
+
* 提供路线规划的基础功能,包括路线搜索、地图渲染、标记点管理等
|
|
4
|
+
* 所有具体的路线规划服务类都继承自此类
|
|
5
|
+
*
|
|
6
|
+
* 主要功能:
|
|
7
|
+
* - 路线搜索和结果管理
|
|
8
|
+
* - 路线在地图上的可视化渲染
|
|
9
|
+
* - 起点、终点和途经点的标记显示
|
|
10
|
+
* - 自动视野调整
|
|
11
|
+
* - 地图元素的清理和管理
|
|
12
|
+
*
|
|
13
|
+
* @category Services
|
|
14
|
+
*/
|
|
15
|
+
export class BaseRoute {
|
|
16
|
+
/**
|
|
17
|
+
* 创建路线规划服务基类实例
|
|
18
|
+
* @param {object} options 配置选项
|
|
19
|
+
* @param {object} [options.renderOptions] 渲染选项
|
|
20
|
+
* @param {Engine} [options.renderOptions.engine] 渲染引擎实例
|
|
21
|
+
* @param {boolean} [options.renderOptions.autoViewport] 是否自动调整视野
|
|
22
|
+
*/
|
|
23
|
+
constructor(options?: {
|
|
24
|
+
renderOptions?: {
|
|
25
|
+
engine?: Engine;
|
|
26
|
+
autoViewport?: boolean | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* 路线搜索结果
|
|
31
|
+
* @type {Object|null}
|
|
32
|
+
*/
|
|
33
|
+
result: Object | null;
|
|
34
|
+
/**
|
|
35
|
+
* 路线线段对象数组
|
|
36
|
+
* @type {Array<Polyline>}
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
private _polylines;
|
|
40
|
+
/**
|
|
41
|
+
* 标记点对象数组
|
|
42
|
+
* @type {Array<Marker>}
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
private _markers;
|
|
46
|
+
options: {
|
|
47
|
+
renderOptions?: {
|
|
48
|
+
engine?: Engine;
|
|
49
|
+
autoViewport?: boolean | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 搜索路线
|
|
54
|
+
* 根据起点和终点计算最优路线
|
|
55
|
+
* @param {Array<number>|THREE.Vector3|THREE.Vector2} start 起点坐标 [lng, lat]
|
|
56
|
+
* @param {Array<number>|THREE.Vector3|THREE.Vector2} end 终点坐标 [lng, lat]
|
|
57
|
+
* @param {object} [opts] 搜索选项
|
|
58
|
+
* @param {Array<Array<number>|THREE.Vector3|THREE.Vector2>} [opts.waypoints] 途经点坐标数组,只有{@link DrivingRoute}支持途经点
|
|
59
|
+
* @returns {Promise<Object>} 路线搜索结果
|
|
60
|
+
* @example
|
|
61
|
+
* ```javascript
|
|
62
|
+
* const result = await route.search(
|
|
63
|
+
* new THREE.Vector3(116.404, 39.915, 0), // 起点
|
|
64
|
+
* new THREE.Vector3(116.414, 39.925, 0), // 终点
|
|
65
|
+
* {
|
|
66
|
+
* waypoints: [new THREE.Vector3(116.409, 39.920, 0)] // 途经点
|
|
67
|
+
* }
|
|
68
|
+
* );
|
|
69
|
+
* console.log('路线距离:', result.distance);
|
|
70
|
+
* console.log('预计时间:', result.duration);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
search(start: Array<number> | THREE.Vector3 | THREE.Vector2, end: Array<number> | THREE.Vector3 | THREE.Vector2, opts?: {
|
|
74
|
+
waypoints?: any[] | undefined;
|
|
75
|
+
}): Promise<Object>;
|
|
76
|
+
/**
|
|
77
|
+
* 渲染路线到地图上
|
|
78
|
+
* 包括路线线段和标记点的渲染
|
|
79
|
+
* @param {Object} result 路线搜索结果
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
private renderMap;
|
|
83
|
+
/**
|
|
84
|
+
* 渲染路线线段
|
|
85
|
+
* 将路线路径绘制为折线对象
|
|
86
|
+
* @param {Object} result 路线搜索结果
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
89
|
+
private renderPly;
|
|
90
|
+
/**
|
|
91
|
+
* 渲染标记点
|
|
92
|
+
* 包括起点、终点和途经点的标记
|
|
93
|
+
* @param {Object} result 路线搜索结果
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
private renderMkr;
|
|
97
|
+
/**
|
|
98
|
+
* 清除地图上的路线元素
|
|
99
|
+
* 移除所有路线线段和标记点
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
private clearMap;
|
|
103
|
+
/**
|
|
104
|
+
* 获取路线搜索结果
|
|
105
|
+
* @returns {Object|null} 路线搜索结果
|
|
106
|
+
*/
|
|
107
|
+
getResult(): Object | null;
|
|
108
|
+
/**
|
|
109
|
+
* 清除路线搜索结果
|
|
110
|
+
* @private
|
|
111
|
+
*/
|
|
112
|
+
private clearResult;
|
|
113
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class DWRoute_Bd {
|
|
2
|
+
constructor(options?: {});
|
|
3
|
+
options: {};
|
|
4
|
+
_baiduMercatorProjection: any;
|
|
5
|
+
_d: {
|
|
6
|
+
plys: never[];
|
|
7
|
+
viaPts: never[];
|
|
8
|
+
viaPtsInfo: never[];
|
|
9
|
+
dragOverlays: never[];
|
|
10
|
+
tipLbl: null;
|
|
11
|
+
sliderMkr: null;
|
|
12
|
+
dragReqFlag: boolean;
|
|
13
|
+
cbkDragPt: null;
|
|
14
|
+
cbkPly: null;
|
|
15
|
+
isSearchByDrag: boolean;
|
|
16
|
+
curDragPly: null;
|
|
17
|
+
dragSrcCityCode: number;
|
|
18
|
+
dragEndCityCode: number;
|
|
19
|
+
mouseOnViaMkr: boolean;
|
|
20
|
+
cxtMenu: never[];
|
|
21
|
+
};
|
|
22
|
+
search(start: any, end: any, opts: any): Promise<{
|
|
23
|
+
walkingPaths: any[][];
|
|
24
|
+
paths: any[];
|
|
25
|
+
} | undefined>;
|
|
26
|
+
_searchOpts: any;
|
|
27
|
+
waypoints: string | undefined;
|
|
28
|
+
_processRaw(json: any, ud: any): {
|
|
29
|
+
walkingPaths: any[][];
|
|
30
|
+
paths: any[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 本格式化起点和终点的请求串
|
|
34
|
+
* @param {Object|Array|Vector2|Vector3} dest 起点或终点对象
|
|
35
|
+
* @return {string} 格式化后的串
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
private _formatCoordYXString;
|
|
39
|
+
/**
|
|
40
|
+
* 判断是否为uid
|
|
41
|
+
* @param {string} uid uid
|
|
42
|
+
* @returns {boolean} 是否为uid
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
private _isUid;
|
|
46
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 驾车路线规划服务类
|
|
3
|
+
* 提供驾车路线规划功能,支持百度地图和天地图两种数据源
|
|
4
|
+
* 继承自 {@link BaseRoute},提供统一的路线规划接口
|
|
5
|
+
*
|
|
6
|
+
* 主要功能:
|
|
7
|
+
* - 根据起点和终点计算最优驾车路线
|
|
8
|
+
* - 支持途经点设置
|
|
9
|
+
* - 自动渲染路线到地图上
|
|
10
|
+
* - 支持多种数据源切换
|
|
11
|
+
* - 支持百度地图和天地图API
|
|
12
|
+
*
|
|
13
|
+
* @category Services
|
|
14
|
+
* @extends BaseRoute
|
|
15
|
+
* @example
|
|
16
|
+
* ```javascript
|
|
17
|
+
* // 创建驾车路线规划实例
|
|
18
|
+
* const drivingRoute = new DrivingRoute({
|
|
19
|
+
* apiSource: mapvthree.Services.API_SOURCE_BAIDU, // 使用百度地图数据源
|
|
20
|
+
* renderOptions: {
|
|
21
|
+
* engine: engine, // 渲染引擎
|
|
22
|
+
* autoViewport: true // 自动调整视野
|
|
23
|
+
* }
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // 搜索路线
|
|
27
|
+
* const result = await drivingRoute.search(
|
|
28
|
+
* new THREE.Vector3(116.404, 39.915, 0), // 起点坐标
|
|
29
|
+
* new THREE.Vector3(116.414, 39.925, 0), // 终点坐标
|
|
30
|
+
* {
|
|
31
|
+
* waypoints: [new THREE.Vector3(116.409, 39.920, 0)] // 途经点
|
|
32
|
+
* }
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export class DrivingRoute extends BaseRoute {
|
|
37
|
+
/**
|
|
38
|
+
* 创建驾车路线规划服务实例
|
|
39
|
+
* @param {object} options 配置选项
|
|
40
|
+
* @param {string} [options.apiSource] API数据源。
|
|
41
|
+
* 可以配置为{@link Services.API_SOURCE_BAIDU}或{@link Services.API_SOURCE_TIANDITU},默认使用配置的数据源
|
|
42
|
+
* @param {object} [options.renderOptions] 渲染选项
|
|
43
|
+
* @param {Engine} [options.renderOptions.engine] 渲染引擎实例
|
|
44
|
+
* @param {boolean} [options.renderOptions.autoViewport] 是否自动调整视野
|
|
45
|
+
* @example
|
|
46
|
+
* ```javascript
|
|
47
|
+
* const drivingRoute = new DrivingRoute({
|
|
48
|
+
* renderOptions: {
|
|
49
|
+
* engine: engine,
|
|
50
|
+
* autoViewport: true
|
|
51
|
+
* }
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
constructor(options?: {
|
|
56
|
+
apiSource?: string | undefined;
|
|
57
|
+
renderOptions?: {
|
|
58
|
+
engine?: Engine;
|
|
59
|
+
autoViewport?: boolean | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* 查询类型:驾车路线规划
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
readonly QUERY_TYPE: string;
|
|
68
|
+
/**
|
|
69
|
+
* 返回类型:驾车路线规划结果
|
|
70
|
+
* @type {number}
|
|
71
|
+
* @readonly
|
|
72
|
+
*/
|
|
73
|
+
readonly RETURN_TYPE: number;
|
|
74
|
+
/**
|
|
75
|
+
* 路线类型:驾车路线
|
|
76
|
+
* @type {number}
|
|
77
|
+
* @readonly
|
|
78
|
+
*/
|
|
79
|
+
readonly ROUTE_TYPE: number;
|
|
80
|
+
/**
|
|
81
|
+
* 服务名称
|
|
82
|
+
* @type {string}
|
|
83
|
+
* @readonly
|
|
84
|
+
*/
|
|
85
|
+
readonly name: string;
|
|
86
|
+
/**
|
|
87
|
+
* API数据源类型
|
|
88
|
+
* @type {string}
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
private apiSource;
|
|
92
|
+
/**
|
|
93
|
+
* 具体的路线规划实现实例
|
|
94
|
+
* @type {DWRoute_Bd|DWRoute_Tdt}
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
private _dw;
|
|
98
|
+
/**
|
|
99
|
+
* 渲染引擎实例
|
|
100
|
+
* @type {Engine}
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
private _engine;
|
|
104
|
+
/**
|
|
105
|
+
* 创建具体的路线规划实现实例
|
|
106
|
+
* 根据API数据源类型创建对应的实现类
|
|
107
|
+
* @param {object} options 配置选项
|
|
108
|
+
* @returns {DWRoute_Bd|DWRoute_Tdt} 路线规划实现实例
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
111
|
+
private _createInstance;
|
|
112
|
+
}
|
|
113
|
+
import { BaseRoute } from './BaseRoute';
|