2016-06-16 14 views
-1

Google Map API Referenceを使用して矩形ジオフェンスを作成しようとしています。このAPI私は取得していますを使用: GoogleマップGeofence - 矩形を描画

  1. 北東緯度経度&
  2. サウスウエスト緯度経度&

しかし、私のプロジェクトのために、私はすべての4頂点緯度たいです。 &ロング。座標。これを達成するために私を助けてください。どんな助けもありがとう。擬似コードで

答えて

0

あなたはNE、SW

North-East Latitude & Longitude = north_lat, east_lng 
South-West Latitude & Longitude = south_lat, west_lng 

を持っている場合は、RECTのCOORDを持っている...

rectangle coord = (north_lat, west_lng) 
        (north_lat, east_lng) 
        (south_lat, east_lng) 
        (south_lat, west_lng) 
or using eg: the coords 

var bounds = { 
    north: 44.599, 
    south: 44.490, 
    east: -78.443, 
    west: -78.649 
}; 

あなたは長方形

rectangle = new google.maps.Rectangle({ 
    bounds: bounds 
}); 
を使用することができます