简体   繁体   English

我想创建一个Android应用程序,其中包含提供路线的地图,但不包括Google地图

[英]I want to make an Android app with a map that provides directions, but not Google Maps

I want to make an Android App that loads a map that I have created of the inside of a building. 我想制作一个Android应用程序来加载我在建筑物内部创建的地图。 I want it to provide directions between one room to another. 我想让它提供一个房间到另一个房间之间的路线。 And between floors if possible. 如果可能的话,在楼层之间

I would like the map to be zoomable, and clickable too. 我希望地图可以缩放,也可以点击。 ie you can click where you are, and where you want to go, and the app will provide the directions. 即你可以点击你所在的位置,以及你想去的地方,应用程序将提供指示。 OR you enter into text boxes what room you are at, and where you want to go, and again, directions are provided. 或者您在文本框中输入您所在的房间以及您想去的地方,并再次提供说明。

I did stumble across something that allowed you to use an open source map and add your own nodes to each corner, or place of reference. 我偶然发现了允许您使用开源地图并将自己的节点添加到每个角落或参考地点的内容。 But I can not find the site any more, after an hour of Google searching. 但经过一个小时的Google搜索后,我再也找不到该网站了。

Does anyone have any idea how I could do this? 有谁知道我怎么能做到这一点?

This is one of them instances where the idea sounds simple but really is not. 这是其中一个实例,其中的想法听起来很简单但实际上并非如此。 There are many tasks you need to resolve, some already talked about. 您需要解决许多任务,有些已经讨论过了。

1) How to model the office. 1)如何塑造办公室。 This needs to be done so that it is easy for you to model but the file is small. 这需要完成,以便您可以轻松建模,但文件很小。 It has to be in a format that your path finding algorithm can understand. 它必须采用您的路径查找算法可以理解的格式。 This means as you develop the path finding you will be making changes to the data. 这意味着在开发路径查找时,您将对数据进行更改。

2) Location finding / input. 2)位置查找/输入。 Done by hardware (gps will not cut it) or user says where they are. 由硬件完成(gps不会削减它)或用户说出它们的位置。 Could be done with NFC and tags placed around in the office, not an ideal solution, the tags have to be visible. 可以通过放置在办公室周围的NFC和标签来完成,而不是理想的解决方案,标签必须是可见的。 The user could input their location but they may be lost and not know where they are. 用户可以输入他们的位置,但他们可能会丢失,不知道他们在哪里。

3) How to present the data, you could write a magical 3D app showing a mission impossible building layout. 3)如何呈现数据,你可以写一个神奇的3D应用程序,显示任务不可能的建筑布局。 That will be six months work in it self! 这将是六个月的自我工作! Remember, your map is in 3D, road maps tend to be 2D. 请记住,您的地图是3D,道路地图往往是2D。 (with some fly overs...) (有些飞过......)

4) Progress tracking. 4)进度跟踪。 The app really needs to know how you are doing so if you go off the route it'll tell you to go back. 该应用程序真的需要知道你是如何做到这一点,如果你走了它会告诉你回去的路线。 This again will be hard to achieve indoors. 这在室内很难实现。 Progress tracking is one area that PND (Personal Navigation Device) manufactures spend time on as it really effects user confidence in the software. 进度跟踪是PND(个人导航设备)制造商花费时间的一个领域,因为它真正影响用户对软件的信心。

Having worked at TomTom all I can say you could be at this for years. 在TomTom工作过,我可以说你可能会在这里工作多年。

As this is a collage project could I suggest a simpler project? 由于这是一个拼贴项目,我可以建议一个更简单的项目吗?

Do it with 2D map, simple grid based map a bit like the classic mouse in a maze problem. 使用2D地图,简单的基于网格的地图,有点像迷宫问题中的经典鼠标。 Implement A* for the path finding. 为路径查找实现A *。 Once done you could then if you have time extend it for your original plan. 完成后,如果您有时间延长原始计划,则可以。

A book I have found very good in the past is "Programming Game AI by example". 我过去发现非常好的一本书是“通过实例编程游戏AI”。 ISBN 1-55622-078-2. ISBN 1-55622-078-2。 Chapter 8 is all about path finding and has a very nice part on A*. 第8章是关于路径查找的,并且在A *上有很好的部分。

Good luck. 祝好运。 :) :)

While this may not be the answer you are looking for: 虽然这可能不是您正在寻找的答案:

You could always write an app that does this. 您总是可以编写一个执行此操作的应用程序。 If you are already willing to position the nodes on the map, you could hypothetically write a program that uses a (primarily used) game pathing algorithm, such as A*, and figure out a route from there. 如果您已经愿意在地图上定位节点,您可以假设编写一个使用(主要使用的)游戏路径算法的程序,例如A *,并从中找出路线。 It would be tricky, but I would think that by placing Nodes and vector-mapping them with a cost associated with the vectors (maybe measured in feet/meters or something like that), you might be able to set that up with A*... 这将是棘手的,但我认为通过放置节点和矢量映射它们与向量相关的成本(可能以英尺/米或类似的方式测量),您可能能够用A *设置它。 ..

Hard to say. 很难说。 I tried a quick Google and came up empty as well. 我尝试了一个快速的谷歌,也出现了空洞。

You can create a MapActivity which can then house a MapView ( MapView can not be embedded in any other Activity ), which is an honest to goodness interactive map, but it's not exactly full featured. 你可以创建一个MapActivity ,然后可以容纳一个MapViewMapView不能嵌入到任何其他Activity中 ),这是一个诚实的善良交互式地图,但它并不完全是全功能的。

MapView is mainly meant to display a map of a specific area with custom overlays on it. MapView主要用于显示特定区域的地图,并在其上显示自定义叠加层。 You can set the focus of the map, the zoom level, if it displays traffic data, and a few other minor options. 您可以设置地图的焦点,缩放级别,是否显示流量数据以及其他一些次要选项。 But beyond that, you'd have to construct the overlay of the route your self. 但除此之外,你必须构建自己路线的叠加层。 And there's no sort of turn by turn direction functionality or anything. 转弯方向功能或任何东西都没有转弯。 They are just "dumb" overlays. 它们只是“哑”的叠加。

Google DID however recently update the Google Maps app to include indoor maps & navigation. Google DID最近更新了Google地图应用,以包含室内地图和导航。 They provide a site that you can go to and submit a floor plan of your building, so it can be added to the official app. 他们提供了一个站点,您可以访问并提交建筑物的平面图 ,因此可以将其添加到官方应用程序中。

Once your floor plan is officially added, you could just launch the official app to do your navigation for you using an Intent like this: 一旦您的平面图正式添加,您可以使用这样的Intent启动官方应用程序为您进行导航:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

I had exactly faced the same sort of issue during my Masters project. 我在硕士项目期间遇到了同样的问题。 However, my solution isn't really complete but this is how I planned it. 但是,我的解决方案并不是很完整,但这就是我计划的方式。 I anyhow couldn't implement it fully due to various restrictions. 由于各种限制,我无论如何都无法完全实现它。 This might sound complex but I'm not really sure how to put it across. 这可能听起来很复杂,但我不确定如何把它穿过。

  1. Store maps statically and not dynamically - what I mean is, pictures/photos popping up when someone wants to go from one room to another or one floor to another. 静态地存储地图而不是动态存储 - 我的意思是,当有人想要从一个房间到另一个房间或从一个楼层到另一个房间时,图片/照片会弹出。 Dynamic routing is a bit difficult. 动态路由有点困难。 Have pictures stored before hand so that they pop up. 手动存放图片,以便弹出。

  2. Devise shortest path algorithm something like Dijkstra's algorithm. 设计像Dijkstra算法那样的最短路径算法。 You'll get ready-made java programs for the execution of this algorithm. 您将获得用于执行此算法的现成java程序。 Using this, you can obtain routes. 使用此功能,您可以获取路线。 Once the map is available, making it clickable and adding zooming options shouldn't be much of a problem. 一旦地图可用,使其可点击并添加缩放选项应该不是一个大问题。

Combine both steps somehow (sorry, no code here 'cuz I myself couldn't come up with one). 以某种方式结合这两个步骤(对不起,这里没有代码'因为我自己无法想出一个)。 As Richard says above, I had NFC in my mind to implement it (my entire project was based on this). 正如理查德在上面所说,我在脑海中实现了它(我的整个项目都基于此)。 NFC is basically an RFID technology and hence wireless. NFC基本上是RFID技术,因此是无线的。 You can use 802.11 b/g/n for implementing the network side of it. 您可以使用802.11 b / g / n来实现它的网络端。 If you need some more help, please let me know. 如果您需要更多帮助,请告诉我。 Will help how much ever I can. 将尽我所能帮助。

All the best. 祝一切顺利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM