CLLocationCoordinate2D数组的双精度数组

时间:2017-02-15 04:06:20

标签: arrays swift mapkit cllocationcoordinate2d

我将用户的经度和lattiude上传到两个单独的键值对下的firebase,然后在mapView上我拍摄快照并获取经度和lattiude。我必须将它们存储为字符串,但我将它们更改为双精度并将它们存储在二维的二维数组中。然后我需要将它存储在CLLocationCoordinate2D数组中。然后我需要在MapView上绘制那些。我陷入困境,如何将它们变成CLLocationCoordinate2D数组,然后绘制这些位置,以便它们都显示在地图上。

我的2D数组如下所示:bookLoc[[121.09900,56.5999],[123.94949, 45.0099]] //etc there are more points but I think this gets the point accoss.

我不确定如何给出多个坐标的CLLocationCoordinate2DMake。谢谢

1 个答案:

答案 0 :(得分:0)

使用Sub Test() Dim r As Long, LastRow As Long Dim RemainingDay As Double '<--| With Worksheets("Latency") '<--| reference worksheet "Latency" LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row '<--| get row index of its column A last not empty cell Application.ScreenUpdating = False For r = 2 To LastRow RemainingDay = 0 '<--| ' ****** add the extra if at the line below with an And ***** If Weekday(.Range("K" & r).Value, vbSaturday) > 2 And .Range("o" & r).Value Like "Fail" Then '<--| having 'Weekday()' function starting from "Saturday", Select Case True Case InStr(.Range("P" & r).Text, "Moved to SA (Compatibility Reduction)") > 0, _ InStr(.Range("P" & r).Text, "Moved to SA (Failure)") > 0, _ InStr(Range("P" & r).Text, "Gold framing") > 0 If .Range("M" & r) - RemainingDay >= 1 Then .Range("M" & r).Cells.Font.ColorIndex = 3 Else .Range("M" & r).Cells.Font.ColorIndex = 0 End If End Select End If Next r End With End Sub

map