设计WPF地图控件 [英] Designing a WPF map control

查看:112
本文介绍了设计WPF地图控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑在WPF中制作一个简单的地图控件,并且正在考虑基本地图界面的设计,并且想知道是否有人对此提供了一些好的建议.

I'm thinking about making a simple map control in WPF, and am thinking about the design of the basic map interface and am wondering if anyone has some good advice for this.

我想使用的是ScrollViewer(无滚动条)作为查看端口",然后将所有内容堆叠在画布上.从Z-Index = 0开始,我在想:

What I'm thinking of is using a ScrollViewer (sans scroll bars) as my "view port" and then stacking everything up on top of a canvas. From Z-Index=0 up, I'm thinking:

  1. 用于纬度/经度计算,控件定位,Z索引堆叠的基础画布.
  2. 多个Grid元素代表不同缩放级别的地图.使用网格使平铺更加容易.
  3. 使用位置数据映射对象.
  4. 地图控件(缩放滑块,概述等).
  5. 具有鼠标移动事件的滚动查看器,用于平移和缩放.

有人对我应该如何构建它发表任何评论建议吗?

Any comments suggestions on how I should be building this?

推荐答案

如果您正在寻找一个良好的开端,则可以使用 SharpMap 项目,然后从那里进行构建.如果我记得有一些人已经在为SharpMap制作WPF渲染器,那么您可能还需要一些代码.

If you're looking for a good start, you can use the foundation of code supplied by the SharpMap project and build out from there. If I recall there were a few people already working on a WPF renderer for SharpMap, so you may also have some code to begin with.

我亲自在C#2.0应用程序中使用SharpMap,该应用程序将GIS数据与实时GPS数据结合在一起,并且非常成功. SharpMap为我提供了处理GIS数据的转换套件,以及用于更改GIS信息的数学基础.将非呈现代码与WPF前端一起使用应该相对直接,因为它们已经具有与数据分离的呈现.

I've personally used SharpMap in a C# 2.0 application that combined GIS data with real time GPS data, and it was very successful. SharpMap provided me the transformation suite to handle GIS data, along with the mathematical foundation to work with altering GIS information. It should be relatively straightforward to use the non-rendering code with a WPF frontend, as they already have presentation separated from the data.

(添加了有关我如何使用SharpMap的更多详细信息)

这篇关于设计WPF地图控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆