在ArcGIS Maps SDK for .NET MAUI示例中添加搜索图层

ivqmmu1c  于 2023-11-20  发布在  .NET
关注(0)|答案(1)|浏览(198)

我正在使用本教程https://developers.arcgis.com/net/maui/sample-code/find-place//来尝试添加对ArcGIS Online上托管的图层的搜索。Map会出现,但如果我删除所有错误,则不会出现搜索框。
另外,请解释一下,如果我只需要更改_geolocator URI来搜索图层。
这是两个问题,请大家耐心听我说
错误出现在下面的代码中,因为代码中没有引用

  1. // Enable all controls now that the locator task is ready.
  2. MySearchBox.IsEnabled = true;
  3. MyLocationBox.IsEnabled = true;
  4. MySearchButton.IsEnabled = true;
  5. MySearchRestrictedButton.IsEnabled = true;

字符串
拜托,我漏掉了什么?
我的MainPage.xaml如下所示:

  1. <esri:MapView x:Name="MainMapView" Grid.Row="1" Grid.RowSpan="2" Map="{Binding Map, Source={StaticResource MapViewModel}}" />
  2. <toolkit:SearchView x:Name="MainSearchView" GeoView="{Binding Source={Reference MainMapView}}" Grid.Row="0" Grid.RowSpan="2" />

xsuvu9jc

xsuvu9jc1#

这些错误是因为我的MainPage.xaml没有必要的xaml MySearchBox(Entry)和其他控件而引发的。
只是添加了控制和一切工作正常。

相关问题