寻找一个简单的 Silverlight 地图组件 [英] Looking for a simple Silverlight map component

查看:28
本文介绍了寻找一个简单的 Silverlight 地图组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种轻量级地图组件,它可以显示美国地图并允许用户单击某个州并查看与该州有关的信息.我要显示的数据在我的数据库中.我只需要知道选择了什么状态,以便我可以显示详细信息.这是我为了熟悉 Silverlight 而正在做的事情.

I am looking for a light-weight map component that displays a map of the US and allows users to click on a State and see information pertaining to that state. The data I want to display is in my database. I just need to know what state was selected so I can display the detail. This is something I am doing to get familiar with Silverlight.

到目前为止,我对 Silverlight/Maps 所做的所有搜索都向我指出了比我需要的要复杂得多的解决方案.我的看法是,使用 Bing 地图来完成这个简单的任务会浪费 Bing 提供的功能.

All the searches for Silverlight/ Maps I have done so far have pointed me at solutions that are far more complicated than I need. My perception is that using Bing Maps to do this simple task would a waste of the features provide by Bing.

有人知道这样的组件吗?Bing Maps 不是适合这项工作的工具,我错了吗?

Anyone know of such a Component? Am I wrong that Bing Maps is not the right tool for the job?

TIA!

推荐答案

如果您可以访问 Expression Studio(特别是 Expression Design),则将地图创建为基于矢量的图像非常容易.与图像相比,Xaml 中的多路径在存储和提供方面也相对高效.

If you have access to Expression Studio (specifically Expression Design), creating maps as vector based images is quite easy. Poly-paths in Xaml are also relatively efficient to store and serve up compared to images.

您将地图导入为背景图像,然后使用钢笔工具在全国范围内进行点对点追踪.将所有这些路径段组合成一条路径.然后为每个状态创建一个单独的多边形路径(关闭它们以允许填充).

You import a map as a background image and use the pen tool to dot-to-dot trace around the country. Combine all those path segments into a single path. Then create a separate poly-path for each state (close them to allow for a fill).

构建所有这些需要几个小时(我知道已经为世界地图国家选择器完成了这个……下面样式的多边形需要 4-5 个小时的实心时间):

It will take a few hours to build all this (I know having done this for a world map country selector... took 4-5 hours solid for the one polygon styled below):

通过填充的多边形路径突出显示每个状态(通过更改填充颜色)在鼠标进入/鼠标离开事件中是微不足道的.

By having each state represented by a filled polygon-path highlighting (by changing the fill colour) is trivial on mouse-enter/mouse-leave events.

如果您想要风格地图,请移除图像,否则使用状态多边形上的透明度以通过翻转显示地图.

If you want stylistic map, remove the image, otherwise use transparency on the state polygons to show the map through the roll-overs.

如果你有一个绘图板并用笔进行这种点对点的工作,速度大约比使用鼠标快 5 倍!

And if you get yourself a graphic tablet and pen this sort of point-to-point work is about 5 times faster than with a mouse!

这篇关于寻找一个简单的 Silverlight 地图组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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