private bool addMarkerAtAdres(string Adres) { datacontract.locationResult loc = getAdres(Adres); IPoint fromXY; IPoint toXY; IRgbColor innerClr; IRgbColor outlineClr; if (loc != null) { fromXY = new ESRI.ArcGIS.Geometry.Point() { X = loc.Location.Lon_WGS84, Y = loc.Location.Lat_WGS84, SpatialReference = wgs }; toXY = geopuntHelper.Transform(fromXY as IGeometry, map.SpatialReference) as IPoint; innerClr = new RgbColor() { Red = 255, Blue = 0, Green = 255 }; outlineClr = new RgbColor() { Red = 0, Blue = 0, Green = 0 }; geopuntHelper.AddGraphicToMap(map, toXY, innerClr, outlineClr, 12, false); geopuntHelper.AddTextElement(map, toXY, loc.FormattedAddress); infoLabel.Text = geopuntHelper.adresTypeStringTranslate(loc.LocationType); view.Refresh(); return(true); } return(false); }
private void saveAdres() { string searchString; IPoint fromXY; IPoint toXY; //get adres string if (suggestionList.SelectedIndex == -1) { searchString = zoekText.Text + ", " + gemeenteBox.Text; } else { searchString = suggestionList.SelectedItem.ToString(); } //get the adres XY, return if no result datacontract.locationResult loc = getAdres(searchString); if (loc == null) { return; } //if no adres feature class yet, create it. if (adresFC == null) { this.Visible = false; string fcPath = geopuntHelper.ShowSaveDataDialog("Save as .."); this.Visible = true; if (fcPath == null) { return; } createAdresFeatureClass(fcPath, map.SpatialReference); } //reproject the point fromXY = new PointClass() { X = loc.Location.Lon_WGS84, Y = loc.Location.Lat_WGS84, SpatialReference = wgs }; toXY = geopuntHelper.Transform(fromXY as IGeometry, map.SpatialReference) as IPoint; //add the adres to to the adres feature class addAdres2FC(toXY.X, toXY.Y, map.SpatialReference, loc.FormattedAddress, loc.LocationType); infoLabel.Text = loc.FormattedAddress + " opgeslagen naar " + adresFC.AliasName; view.Refresh(); }