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
 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);
     }
 }
        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);
 }
 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);
     }
 }
        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);
            //}
        }
 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);
 }
 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();
 }