修正编译错误
This commit is contained in:
parent
0d6f4d4f71
commit
3aa13f4560
@ -38,8 +38,6 @@ return GetBuilder<KRHomeController>(
|
|||||||
event.source == MapEventSource.multiFingerEnd) {
|
event.source == MapEventSource.multiFingerEnd) {
|
||||||
|
|
||||||
controller.kr_isUserMoving.value = true;
|
controller.kr_isUserMoving.value = true;
|
||||||
|
|
||||||
controller.showMarkersMap();//刷新地图marker
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -75,72 +73,12 @@ return GetBuilder<KRHomeController>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
MarkerLayer _kr_buildMarkers(BuildContext content){
|
MarkerLayer _kr_buildMarkers(BuildContext content){
|
||||||
int zoom = 2;
|
|
||||||
try{
|
|
||||||
zoom = controller.kr_mapController.camera.zoom.toInt();
|
|
||||||
}catch(e){
|
|
||||||
e.printError();
|
|
||||||
}
|
|
||||||
print("当前层级:$zoom ");
|
|
||||||
if(zoom<5){//国家
|
|
||||||
return MarkerLayer(
|
|
||||||
markers: controller.kr_subscribeService.countryOutboundList
|
|
||||||
.map((item) => _buildStyledProvMarker(item))
|
|
||||||
.toList(),
|
|
||||||
);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
return MarkerLayer(
|
return MarkerLayer(
|
||||||
markers: controller.kr_subscribeService.allList
|
markers: controller.kr_subscribeService.allList
|
||||||
.map((item) => _buildStyledMarker(item))
|
.map((item) => _buildStyledMarker(item))
|
||||||
.toList(),
|
.toList(),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Marker _buildStyledProvMarker(dynamic node) {
|
|
||||||
print("省级:${node.country} #####${node.outboundList}");
|
|
||||||
double z = controller.kr_mapController.camera.zoom;
|
|
||||||
double lat = 0.0;
|
|
||||||
double lng = 0.0;
|
|
||||||
String id = "";
|
|
||||||
int len = -1;
|
|
||||||
if(node.outboundList.isNotEmpty){
|
|
||||||
KROutboundItem f = node.outboundList.first as KROutboundItem;
|
|
||||||
len = node.outboundList.length;
|
|
||||||
id = f.id;
|
|
||||||
lat = f.latitudeCountry;
|
|
||||||
lng = f.longitudeCountry;
|
|
||||||
|
|
||||||
print("${f.country} -lat坐标 ${lat},点坐标${f.latitude} lng坐标 ${lng},点坐标${f.longitude}");
|
|
||||||
}
|
|
||||||
double fontSize = 8;
|
|
||||||
double radius = 0+len*10 + z*10;
|
|
||||||
double radius2 = 20;
|
|
||||||
if(z<3){
|
|
||||||
fontSize = 8;
|
|
||||||
radius = 0+len*10 + z*10;
|
|
||||||
radius2 = 15;
|
|
||||||
}else if(z<4){
|
|
||||||
fontSize = 8;
|
|
||||||
radius = 30+len*10 + z*10;
|
|
||||||
radius2 = 20;
|
|
||||||
}else if(z<5){
|
|
||||||
fontSize = 10;
|
|
||||||
radius = 70+len*10 + z*10;
|
|
||||||
radius2 = 20;
|
|
||||||
}else if(z<6){
|
|
||||||
fontSize = 12;
|
|
||||||
radius = 100+len*10+ z*10;
|
|
||||||
radius2 = 30;
|
|
||||||
}
|
|
||||||
return Marker(
|
|
||||||
key: ValueKey('key_${id}'),
|
|
||||||
point: LatLng(lat, lng),
|
|
||||||
width: radius,
|
|
||||||
height: radius,
|
|
||||||
child: _buildDoubleCircle(radius,radius2, Colors.blue, len,fontSize),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/// 构建样式化的标记
|
/// 构建样式化的标记
|
||||||
Marker _buildStyledMarker(dynamic node) {
|
Marker _buildStyledMarker(dynamic node) {
|
||||||
print("原始Marker:${node}");
|
print("原始Marker:${node}");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user