private void LaunchGazetteer()
        {
            var selectOptions = new NamedPlaceSelectionOptions {
                PlaceNameSeed = ""
            };

            if (BeforeLocationSelection != null)
            {
                BeforeLocationSelection(selectOptions);
            }

            PluginManager.Instance.StartSelect <PlaceName>((result) => {
                var place = result.DataObject as PlaceName;
                if (place != null)
                {
                    lat.Value = place.Latitude;
                    lon.Value = place.Longitude;
                    if (LocationChanged != null)
                    {
                        var locality = place.Name;
                        if (place.PlaceNameType == PlaceNameType.OffsetAndDirection)
                        {
                            locality = string.Format("{0} {1} {2} of {3}", place.Offset, place.Units, place.Direction, place.Name);
                        }
                        LocationChanged(place.Latitude, place.Longitude, null, null, locality, "EGaz");
                    }
                }
            }, LookupOptions.None, selectOptions);
        }
Exemplo n.º 2
0
        private void LaunchGazetteer()
        {
            var selectOptions = new NamedPlaceSelectionOptions { PlaceNameSeed = "" };

            if (BeforeLocationSelection != null) {
                BeforeLocationSelection(selectOptions);
            }

            PluginManager.Instance.StartSelect<PlaceName>((result) => {
                var place = result.DataObject as PlaceName;
                if (place != null) {
                    lat.Value = place.Latitude;
                    lon.Value = place.Longitude;
                    if (LocationChanged != null) {
                        var locality = place.Name;
                        if (place.PlaceNameType == PlaceNameType.OffsetAndDirection) {
                            locality = string.Format("{0} {1} {2} of {3}", place.Offset, place.Units, place.Direction, place.Name);
                        }
                        LocationChanged(place.Latitude, place.Longitude, null, null, locality, "EGaz");
                    }
                }
            }, LookupOptions.None, selectOptions);
        }
Exemplo n.º 3
0
        private void LaunchGazetteer(LatLongInput lat, LatLongInput lon, bool updateLocality)
        {
            NamedPlaceSelectionOptions selectOptions = new NamedPlaceSelectionOptions { PlaceNameSeed = txtLocality.Text };

            PluginManager.Instance.StartSelect<PlaceName>((result) => {
                var place = result.DataObject as PlaceName;
                if (place != null) {
                    lat.Value = place.Latitude;
                    lon.Value = place.Longitude;
                    txtPosSource.Text = "EGaz";
                    if (updateLocality) {
                        UpdateLocality(place);
                    }
                }
            }, LookupOptions.None, selectOptions);
        }
Exemplo n.º 4
0
 void ctlPosition_BeforeLocationSelection(NamedPlaceSelectionOptions options)
 {
     options.PlaceNameSeed = txtLocality.Text;
 }