コード例 #1
0
 void HandleGeocoderResponse(ForwardGeocodeResponse res)
 {
     _hasResponse = true;
     if (null != res.Features && res.Features.Count > 0)
     {
         var center = res.Features[0].Center;
         _inputField.text = string.Format("{0},{1}", center.x, center.y);
         _coordinate      = res.Features[0].Center;
     }
     Response = res;
     OnGeocoderResponse(res);
 }
コード例 #2
0
ファイル: ReloadMap.cs プロジェクト: jegusquiza/Unity_mapa
 void ForwardGeocoder_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     if (response == null)
     {
         return;
     }
     _camera.transform.position = _cameraStartPos;
     if (null != response.Features && response.Features.Count > 0)
     {
         _map.UpdateMap(response.Features[0].Center, (int)_zoomSlider.value);
     }
 }
コード例 #3
0
        public void SerializesAndDeserializesForward()
        {
            // First, deserialize the example response
            ForwardGeocodeResponse forwardResp =
                this.geocoder.Deserialize <ForwardGeocodeResponse>(this.forwardResponse);

            // Then deserialize it back to a string.
            string forwardReserialized = JsonConvert.SerializeObject(forwardResp, JsonConverters.Converters);

            // Ensure the two match
            Assert.AreEqual(this.forwardResponse, forwardReserialized);
        }
コード例 #4
0
 void ForwardGeocoder_OnGeocoderResponse(ForwardGeocodeResponse response, bool resetCamera)
 {
     if (response == null)
     {
         return;
     }
     if (resetCamera)
     {
         _camera.transform.position = _cameraStartPos;
     }
     ForwardGeocoder_OnGeocoderResponse(response);
 }
コード例 #5
0
 void HandleGeocoderResponse(ForwardGeocodeResponse res)
 {
     _hasResponse = true;
     if (null != res.Features && res.Features.Count > 0)
     {
         _coordinate = res.Features[0].Center;
     }
     Response = res;
     if (OnGeocoderResponse != null)
     {
         OnGeocoderResponse(this, EventArgs.Empty);
     }
 }
コード例 #6
0
        void HandleGeocoderResponse(ForwardGeocodeResponse res)
        {
            _features    = res.Features;
            _isSearching = false;
            this.Repaint();

            //_hasResponse = true;
            //_coordinate = res.Features[0].Center;
            //Response = res;
            //if (OnGeocoderResponse != null)
            //{
            //	OnGeocoderResponse(this, EventArgs.Empty);
            //}
        }
コード例 #7
0
 void HandleGeocoderResponse(ForwardGeocodeResponse res)
 {
     //null if no internet connection
     if (res != null)
     {
         //null if invalid token
         if (res.Features != null)
         {
             _features = res.Features;
         }
     }
     _isSearching = false;
     this.Repaint();
 }
コード例 #8
0
 private void HandleGeocoderResponse(ForwardGeocodeResponse res)
 {
     _hasResponse = true;
     if (null == res)
     {
         _inputField.text = "no geocode response";
     }
     else if (null != res.Features && res.Features.Count > 0)
     {
         var center = res.Features[0].Center;
         _coordinate = res.Features[0].Center;
     }
     Response = res;
     OnGeocoderResponse(res);
 }
コード例 #9
0
 void HandleGeocoderResponse(ForwardGeocodeResponse res)
 {
     _hasResponse = true;
     if (null == res)
     {
         Debug.Log("no geocode response");
     }
     else if (null != res.Features && res.Features.Count > 0)
     {
         var center = res.Features[0].Center;
         _coordinate = res.Features[0].Center;
     }
     Response = res;
     OnGeocoderResponse(res);
     myLoc = res.Features[0].Center;
 }
コード例 #10
0
        void HandleGeocoderResponse(ForwardGeocodeResponse res)
        {
            //null if no internet connection
            if (res != null)
            {
                //null if invalid token
                if (res.Features != null)
                {
                    _features = res.Features;
                }
            }
            _isSearching = false;
            this.Repaint();

            //_hasResponse = true;
            //_coordinate = res.Features[0].Center;
            //Response = res;
            //if (OnGeocoderResponse != null)
            //{
            //	OnGeocoderResponse(this, EventArgs.Empty);
            //}
        }
コード例 #11
0
    void HandleGeocoderResponse(ForwardGeocodeResponse res)
    {
        _hasResponse = true;
        if (null == res)
        {
            //_inputField.text = "no geocode response";
        }
        else if (null != res.Features && res.Features.Count > 0)
        {
            var center = res.Features[0].Center;
            //_inputField.text = string.Format("{0},{1}", center.x, center.y);
            _coordinate = res.Features[0].Center;
        }

        Response = res;
        //OnGeocoderResponse(res);

        dungeonsUpdated[dungeonsUpdated.Count - 1].Lat = _coordinate.x;
        dungeonsUpdated[dungeonsUpdated.Count - 1].Lon = _coordinate.y;

        ConvertDungeons();
    }
コード例 #12
0
 void GeocodeInput_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     Cleanup();
     FetchWorldData(_geocodeInput.Coordinate);
 }
コード例 #13
0
 private void SearchLocation_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     _resultsText.text = JsonConvert.SerializeObject(_searchLocation.Response, Formatting.Indented, JsonConverters.Converters);
 }
コード例 #14
0
 /// <summary>
 /// New search location has become available, begin a new _map query.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 private void SearchLocation_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     _map.Center = _searchLocation.Coordinate;
     _map.Update();
 }
コード例 #15
0
 /// <summary>
 /// Start location geocoder responded, update start coordinates.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 void StartLocationGeocoder_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     _coordinates[0] = _startLocationGeocoder.Coordinate;
     //print("goofy");
 }
コード例 #16
0
 /// <summary>
 /// End location geocoder responded, update end coordinates.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 void EndLocationGeocoder_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     _coordinates[1] = _endLocationGeocoder.Coordinate;
 }
コード例 #17
0
 void ForwardGeocoder_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     _camera.transform.position = _cameraStartPos;
     _map.Initialize(response.Features[0].Center, (int)_zoomSlider.value);
 }
コード例 #18
0
 void HandleGeocoderResponse(ForwardGeocodeResponse res)
 {
     base.HandleGeocoderResponse(res);
 }
コード例 #19
0
 /// <summary>
 /// Search location was changed.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 private void SearchLocation_OnGeocoderResponse(ForwardGeocodeResponse response)
 {
     Redraw();
 }