コード例 #1
0
        private void OnGeocodingComplete(string response)
        {
            OnlineMapsGoogleGeocodingResult[] results = OnlineMapsGoogleGeocoding.GetResults(response);
            if (results == null || results.Length == 0)
            {
                Debug.Log(response);
                return;
            }

            OnlineMapsGoogleGeocodingResult r = results[0];

            OnlineMaps.instance.position = r.geometry_location;

            Vector2 center;
            int     zoom;

            OnlineMapsUtils.GetCenterPointAndZoom(new[] { r.geometry_bounds_northeast, r.geometry_bounds_southwest }, out center, out zoom);
            OnlineMaps.instance.zoom = zoom;

            if (marker == null)
            {
                marker = OnlineMapsMarkerManager.CreateItem(r.geometry_location, r.formatted_address);
            }
            else
            {
                marker.position = r.geometry_location;
                marker.label    = r.formatted_address;
            }
        }
コード例 #2
0
 public new static OnlineMapsFindLocationResult[] GetResults(string response)
 {
     OnlineMapsGoogleGeocodingResult[] results = OnlineMapsGoogleGeocoding.GetResults(response);
     return(OnlineMapsUtils.DeepCopy <OnlineMapsFindLocationResult[]>(results));
 }