|
@@ -382,11 +382,14 @@ public class GCYWLayer : YZTRootLayer
|
|
|
taskPointIcons.Clear();
|
|
|
for (int i = 0; i < itemsArray.Length; i++)
|
|
|
{
|
|
|
- GameObject tempObj = Instantiate(taskPointIconPrefab, taskPointIconContent);
|
|
|
- tempObj.name = itemsArray[i].xjItemId;
|
|
|
- tempObj.transform.position = CoordinateConverter.GeoToUnity(double.Parse(itemsArray[i].longitude),
|
|
|
- double.Parse(itemsArray[i].latitude));
|
|
|
- taskPointIcons.Add(tempObj.GetComponent<TaskPointIcon>());
|
|
|
+ if (itemsArray[i].longitude != null && itemsArray[i].latitude != null)
|
|
|
+ {
|
|
|
+ GameObject tempObj = Instantiate(taskPointIconPrefab, taskPointIconContent);
|
|
|
+ tempObj.name = itemsArray[i].xjItemId;
|
|
|
+ tempObj.transform.position = CoordinateConverter.GeoToUnity(double.Parse(itemsArray[i].longitude),
|
|
|
+ double.Parse(itemsArray[i].latitude));
|
|
|
+ taskPointIcons.Add(tempObj.GetComponent<TaskPointIcon>());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
taskPointLineRenderer.positionCount = itemsArray.Length;
|