如何在 Android 中使用路径和区域构建可点击的自定义地图
为了解释我的问题,我将从一个案例研究开始,这不是我必须做的,但它会让你很好地了解我在说什么。
想象一下美国地图,其中有州/省。每个省份都有一个随机的形状(随机是指它不是矩形、三角形或圆形)。我需要独立构建这些形状,正确调整它们的大小并将它们放在屏幕上的正确位置以代表国家/地区。最后,每个省份都应该是可点击的。
为了实现这一点:
1)我不想使用谷歌地图
2)我想我必须使用android路径和android区域构建每个省...你能确认吗?
3)是否有用于构建这些路径的图形工具(photoshop导入?)
4)假设我成功构建了路径,我怎样才能将它们放在屏幕上的正确位置?
5)如何使这些路径可点击?
基本上,我想构建一个带有可点击项目的交互式地图,但不使用谷歌地图,因为它不一定是真正的地图。
谢谢你的帮助,
R。
To explain my problem, I am going to start from a case study that is not what I have to do but which will give you a good idea of what I am talking about.
Imagine the map of the US in which you have the states / provinces. Each of these provinces has got a shape that is random (by random I mean it is not a rectangle, a triangle or a circle). I need to build these shapes independantly, size them correctly and put them at the correct place on the screen to represent the country. Finally, each of these province should be clickable.
To achieve that :
1) I don't want to use google map
2) I guess that I'll have to construct each provine using android path and android region ... can you confirm?
3) Is there a graphical tool for building these paths (photoshop import ?)
4) Assuming that I succeed to build the path, how can I put them at the correct place on the screen ?
5) How can I make these path clickable ?
Basically, I want to build an interactive map with clickable items that doesn't use Google map because it won't necessarly be a real map.
Thanks for your help,
R.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您描述的问题有很多变数:
如果您不想使用谷歌地图,则需要使用其他引擎。有一些可用的开源引擎。
如果您认为不需要地图引擎,则需要提供您自己的美国图像,以便将图像绘制到视图上的图钉上
您打算如何绘制边界?您是否有边界的坐标数据或者您打算手动绘制它们。
我建议首先查看 openstreetmap: http://www.openstreetmap.org/ 其中有很多信息以及创建地图的工具。从那里您可以攻击添加到手机。或者您可以使用他们的 Web api 并构建一个 Web 视图来执行您的建议。
There are lot of variables in the problem you describe:
If you don't want to use google-maps, you'll need to use another engine. There are a few open-source ones available.
If you feel you don't need a map engine, you'll need to provide you're own image of the US to draw on an pin the image to the View
How do you plan to draw the boundaries? Do you have coordinate data for the boundaries or do you plan to draw them manually.
I would suggest first looking at openstreetmap: http://www.openstreetmap.org/ The have a lot of information and tools on creating Maps. From there you can attack adding to the phone. Or you can use their web api and build a web view for doing what you suggest.