Flutter从JSON查找附近的位置

时间:2018-09-06 05:54:29

标签: json flutter

我创建了一个JSON文件,其中包含位置列表,包括纬度和经度

accounts.json

[
  {
    "Accounts": [
      {
        "Name": " Klinik Pakar Mata & Surgeri Tg.Kamal.",
        "TPA Customer ID": "9708",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "22-1, Jalan Tanjong Laboh, Kampung Bahagia, 83000 Batu Pahat, Johor, Malaysia",
        "City (Billing)": "batu pahat",
        "State (Billing)": "Johor",
        "Coordinates" : {
          "Latitude" : "1.8452723",
          "Longitude" : "102.9408952"
        }
      },
      {
        "Name": " KLINIK RS SHIVA SDN.BHD",
        "TPA Customer ID": "740",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "No 3, Medan 23, Bandar Baru Salak Tinggi ",
        "City (Billing)": "Sepang",
        "Postal Code (Billing)": "43900",
        "State (Billing)": "Selangor",
        "Country (Billing)": "Malaysia",
        "Coordinates" : {
          "Latitude" : "2.8106893",
          "Longitude" : "101.73848759999998"
        }
      },
      {
        "Name": "(KLINIK)AL-ISLAM SPECIALIST HOSPITAL",
        "TPA Customer ID": "6002",
        "Organization Type": "Clinic",
        "Organization Subtype": "Specialist",
        "Street (Billing)": "NO.85, JALAN RAJA ABDULLAH, KAMPUNG BARU,50300, WILAYAH PERSEKUTUAN",
        "City (Billing)": "KUALA LUMPUR",
        "Postal Code (Billing)": "50300",
        "State (Billing)": "Wilayah Persekutuan",
        "Coordinates" : {
          "Latitude" : "3.1634816",
          "Longitude" : "101.70350860000008"
        }
      },
      {
        "Name": "02 KLINIK (SUMMERTON) SDN BHD (BAYAN LEPAS)",
        "TPA Customer ID": "7255",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "110-1A-25, SUMMERTON COMPLEX, PERSIARAN BAYAN INDAH, 11900 BAYAN LEPAS, PULAU PINANG",
        "City (Billing)": "BAYAN LEPAS",
        "Postal Code (Billing)": "119000",
        "State (Billing)": "PULAU PINANG",
        "Coordinates" : {
          "Latitude" : "5.338356",
          "Longitude" : "100.30845899999997"
        }
      },
      {
        "Name": "02 KLINIK SDN BHD (AYER HITAM)",
        "TPA Customer ID": "7254",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "1 & 1M, Jalan Ayer Itam",
        "City (Billing)": "Ayer Itam",
        "Postal Code (Billing)": "11500",
        "State (Billing)": "Pulau Pinang",
        "Country (Billing)": "Malaysia",
        "Coordinates" : {
          "Latitude" : "5.4044962",
          "Longitude" : "100.28825080000001"
        }
      },
      {
        "Name": "02 KLINIK SDN BHD(JELUTONG)",
        "TPA Customer ID": "8747",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "129 I/J/K, Jalan Tan Sri Teh Ewe Lim",
        "City (Billing)": "Jelutong",
        "Postal Code (Billing)": "11600",
        "State (Billing)": "Pulau Pinang",
        "Country (Billing)": "Malaysia",
        "Coordinates" : {
          "Latitude" : "5.3923441",
          "Longitude" : "100.30793779999999"
        }
      },
      {
        "Name": "17TH MILES FAMILY CLINIC (SERIAN)",
        "TPA Customer ID": "8645",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "GROUND FLOOR, LOT 1629, BLOCK 5, SSLD, JALAN KUCHING, SERIAN",
        "City (Billing)": "KUCHING",
        "Postal Code (Billing)": "94200",
        "State (Billing)": "Sarawak",
        "Coordinates" : {
          "Latitude" : "1.339687",
          "Longitude" : "110.408278"
        }
      },
      {
        "Name": "17TH MILLES FAMILY CLINIC",
        "TPA Customer ID": "8644",
        "Organization Type": "Clinic",
        "Organization Subtype": "GP",
        "Street (Billing)": "GROUND FLOOR, LOT 1629, BLOCK 5, SSLD, JALAN KUCHING/SERIAN KUCHING",
        "City (Billing)": "KUCHING",
        "State (Billing)": "Sarawak",
        "Coordinates" : {
          "Latitude" : "1.4393803",
          "Longitude" : "110.3291448"
        }
      }
    ]
  }

]

我当前面临的问题是我不确定如何使程序从JSON文件计算附近位置,然后显示距当前位置给定半径内的所有附近位置。

>

0 个答案:

没有答案