问题标签 [mapsui]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
224 浏览

xamarin - Mapsui - 如何提供当前用户的位置和焦点地图?

我正在关注https://mapsui.com/documentation/getting-started-xamarin-forms.html上的快速入门,想知道我是否需要自己获取位置(例如 Xamarin.Essentials 的位置例程)或 Mapsui 将自己获得一个。我在 AndroidManifest 中标记了位置权限,允许访问,但蓝色圆圈仍然指向 0,0 坐标。

编辑:这是代码

不幸的是,对地图没有MyLocationEnabled任何PanLock影响 - 蓝色圆圈仍处于 0,0 且地图未锁定。

0 投票
0 回答
126 浏览

xamarin.forms - 将引脚添加到 Mapsui(Xamarin 表单)时出现异常

我正在尝试向我的 Xamarin Forms Mapsui 控件添加一个引脚。

这是我的 Xaml

这是我的代码:

我在var myPin = new Pin(selectMapControl)...行收到“对象引用未设置为对象的实例。”异常

如果我的 lat 和 lng 都设置为 0 那么它可以工作 这是异常中的堆栈跟踪:

在 Xamarin.Forms.BindableObject.SetValueActual(Xamarin.Forms.BindableProperty 属性,Xamarin.Forms.BindableObject+BindablePropertyContext 上下文,System.Object 值,System.Boolean currentApplying,Xamarin.Forms.Internals.SetValueFlags 属性,System.Boolean 无声)[ 0x00114] 在 D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:510 在 Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty 属性,System.Object 值,Xamarin.Forms.Internals。 SetValueFlags 属性,Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] 在 D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446 在 Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty属性,System.Object 值,System.Boolean fromStyle,System.Boolean checkAccess) [0x0004d] 在 D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:374 在 Xamarin.Forms.BindableObject.SetValue(Xamarin.Forms.BindableProperty 属性,System.Object 值)[0x00000] 在 D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:349 在 Mapsui.UI .Forms.Pin.set_Position (Mapsui.UI.Forms.Position value) [0x00000] in <5cc65edf513349cdba641e049bbf0143>:0 at eLunaApp.Views.RestaurantMapPage.OnAppearing () [0x0008d] in C:\x\elunaapp\eLunaApp\PageRestaurantMap\ RestaurantMapPage.xaml.cs:82 在 Xamarin.Forms.Page.SendAppearing () [0x00045] 在 D:\a\1\s\Xamarin.Forms.Core\Page.cs:452 在 Xamarin.Forms.ShellContent.SendPageAppearing ( Xamarin.Forms.Page 页面)[0x0003b] 在 D:\a\1\s\Xamarin.Forms.Core\Shell\ShellContent.cs:127 在 Xamarin.Forms.ShellContent.SendAppearing () [0x00019] 在 D:\ a\1\s\Xamarin.Forms.Core\Shell\ShellContent.cs:108 在 Xamarin.Forms.ShellContent.OnChildAdded (Xamarin.Forms.元素子)[0x00021] 在 D:\a\1\s\Xamarin.Forms.Core\Shell\ShellContent.cs:138 在 Xamarin.Forms.ShellContent.set_ContentCache (Xamarin.Forms.Page 值)[0x0003b] 在 D :\a\1\s\Xamarin.Forms.Core\Shell\ShellContent.cs:182 在 Xamarin.Forms.ShellContent.Xamarin.Forms.IShellContentController.GetOrCreateContent () [0x0003c] 在 D:\a\1\s\ Xamarin.Forms.Core\Shell\ShellContent.cs:68 在 Xamarin.Forms.Platform.Android.ShellSectionRenderer.OnCreateView(Android.Views.LayoutInflater 充气器,Android.Views.ViewGroup 容器,Android.OS.Bundle savedInstanceState)[0x000f2]在 D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ShellSectionRenderer.cs:166 在 AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater ,System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00021] 在 D:\a\1\s\generated\androidx.fragment.fragment\obj\Release\monoandroid90\generated\src\AndroidX.Fragment.App.Fragment.cs :1950 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.50(intptr,intptr,intptr,intptr,intptr)

0 投票
0 回答
20 浏览

mapsui - MyLocation 符号可以用用户图形更改吗?

是否可以使用外部资源作为 MyLocation 符号?我尝试添加 aSymbolStyle作为Style属性,MapView.MyLocationLayer但它对原始的蓝色图标没有任何影响。此外,在MapView.MyLocationLayer启用时,我无法使用 Layer 的Opacity属性使其透明。

0 投票
1 回答
47 浏览

mapsui - 如何在 MAPSUI 中从一条线的起点和终点删除点

提到的图片中有一条线,两端都有一个点。参考问题https://github.com/Mapsui/Mapsui/issues/956,它仅适用于点特征。但是,如果我们绘制线条、多边形等形状,这些点会出现在顶点/线条的端点上,并且不会通过使用 Layer.style= null 来删除。源代码来自以下分支 https://github.com/Mapsui/Mapsui/tree/master/Samples/Mapsui.Samples.Wpf.Editing/Editing 此行的代码是 Addvertex present 方法中的“if else”在 Editmanager.cs点击查看截图中的问题

0 投票
0 回答
22 浏览

xamarin.forms - MapsUI mapView.Drawables 每个地图还是每个 mapView?

我在 Xamarin.Forms 中使用 MapsUI,通过一张具有多个图层的地图和两个专注于不同事物的不同 MapView,它运行良好。他们使用具有相同图层的相同地图,因此我只需要在其中定义一次几何图形。

将 Drawable 添加到组合中时,我有点困惑。Drawables 在 MapView.Drawables 中,但是在一个 mapview 中添加一个 drawable 会使其也显示在另一个视图中。

我对此没有意见。实际上,这很有帮助,但我需要了解这是预期的和明确定义的行为,还是偶然的。

0 投票
1 回答
68 浏览

c# - How to use a .pgm image file as a custom map in Mapsui

I am developing a wpf app for controlling a ROS based robot. And I want to show a map from the robot in the UI using Mapsui. Currently I am using canvas to display the map so when I have a lot of waypoints and other indicators on the map, it's messy. And the manipulation and touch support is terrible.

I have came across this. But it involve tile structuring which is not okay for my project as I will just be getting a only.pgm file from the robot.

Is there a way I can just display the .pgm file as the background like I do in the canvas and then use layers and other good features of Mapsui on top?

0 投票
1 回答
82 浏览

xamarin.forms - 无法使用 Mapsui 加载离线地图,使用 world.mbtiles

var layer = new TileLayer(new MbTilesTileSource(new SQLiteConnectionString(dbPath,true), null, MbTilesType.None, true, true)); 并将此图层添加到地图

0 投票
1 回答
51 浏览

xamarin.forms - MapsUI 多边形块 mapClick

我有一个带有多个多边形的图层,其中该图层被标记为不是信息层

我还有一个事件处理程序,用于单击 xaml 中定义的地图

此单击在空白区域上效果很好,但如果我单击多边形,则地图单击会被阻止。以前我通过响应多边形的信息事件处理程序并将其路由到处理地图点击的相同代码来解决这个问题,但现在这还不够,因为我需要点击位置的纬度,经度。

如何使多边形不拦截我的点击?