Geographical boundaries of states/provinces -> Google Maps Polygon

前端 未结 4 1113
灰色年华
灰色年华 2020-11-28 20:23

I\'m building a web application that is going to dynamically highlight certain U.S. states and Canadian provinces on a Google Map, based on buttons and click events.

4条回答
  •  心在旅途
    2020-11-28 21:00

    Here's the info for Canadian Provinces. I've copied only the first GPS coordinate from the Google Map link.

    /**
     * Searched for Alberta, Canada and copied the first thing after the @ sign
     * @see https://www.google.bg/maps/place/Yukon+Territory,+Canada/@64.5610006,-141.332713,5z/data=!3m1!4b1!4m5!3m4!1s0x51178198b4528b89:0x2e149cd561cc96ea!8m2!3d64.2823274!4d-135?hl=en
     * @var array
     */
    $provinces_gps = array(
        "AB" => "54.1784838,-123.9541477",
        "BC" => "53.8348151,-135.5103986",
        "MB" => "54.1798816,-104.4465713",
        "NB" => "46.2679312,-68.6551949",
        "NL" => "53.1668149,-69.1783083",
        "NT" => "68.4817407,-136.7732486",
        "NS" => "45.2906308,-65.2759181",
        "NU" => "63.5954344,-124.1555502",
        "ON" => "48.9347914,-93.7155729",
        "PE" => "46.5031512,-63.7525627",
        "QC" => "53.4650568,-77.3895206",
        "SK" => "54.1797758,-114.6389862",
        "YT" => "64.5610006,-141.332713",
    );
    

提交回复
热议问题