如何制作具有自定义地图图像的类似地图的视图? [英] How to make a map-like view that has a custom map image?

查看:121
本文介绍了如何制作具有自定义地图图像的类似地图的视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像标题所说,我需要制作一个非常自定义的视图,其行为类似于MKMapView但是使用自定义图像。也许分享最终目标会更容易。

Like the title says, I need to make a very customized view that behaves like MKMapView however uses a custom image. Perhaps it'll be easier to share what the end goal is.

我正在尝试制作的应用程序是我不时玩的MMO的补充,它也是我正在参加的iOS课程的学期项目。无论如何,我们的想法是创建一个应用程序,在屏幕上显示游戏中的交互式地图。下一步是为应用添加某种叠加效果,以便用户可以直接将自定义位置添加到地图中。

The app I'm trying to make is a supplement to an MMO I play from time to time, it's also my semester project for an iOS class I'm taking. Anyway, the idea is to create an app that displays an interactive map from the game on the screen. The next step is to add some kind of overlay to the app for annotations so as to allow the user to add custom locations directly to the map.


(这是我要添加的图片之一)

所以,这是摘要......

So, here's the summary...


  • 如何添加图像并允许它可以像MKMapView一样可滚动和捏合

  • 如何设置一个带有允许自定义位置坐标的叠加层

任何和所有提示将不胜感激。 :)

Any and all tips would be appreciated. :)

更新:

@andrewap告诉我 http://mapbox.com/mobile/ 这看起来很棒,看起来它只是我需要的东西但是作为初学者,我认为这不在我的技能水平之内。所以如果找到任何其他更简单/更简单的方法,这个问题仍然是开放的,假设有任何方法。

@andrewap showed me http://mapbox.com/mobile/ which looks fantastic and it seems like it would be just what I need but I don't think it's quite within my skill level as a beginner. So this question is still open if any other easier/simpler methods are found, assuming there are any.

我试图熟悉TileMill有点,据我所知,不支持自定义地图图像(如虚构的地图图像,如前图所示)因此并不能完全回答我的问题。但是,如果您希望拥有一个功能齐全的自定义真实世界地图图像,那就太棒了。

I tried to familiarize myself with TileMill a bit and as far as I can tell does not support custom map images (as in fictional map images like the one pictured earlier) therefor does not entirely answer my question. However it's great if you're looking to have a fully functioning custom real-world map image.

(注意:我对编程非常陌生,甚至更新的Objective-C / iOS编程,请在回答时牢记这一点)

推荐答案

对于你在WWDC2010示例代码中所做的工作,有一个非常好的教程。他们拍摄图像并将其切割成四分之一,并将其​​切割成四分之一,依此类推,直到图像图块可以管理,然后使用UIScrollView显示它们。虽然没有实现引脚。您可以使用实际的MKMapview,并使用TileMaps(也来自WWDC2010)中的示例将图像放入地图图块中。您需要使用坐标标记图像,或者将其转换为GeoTiff,然后通过 MapTiler 运行它。您不知道如何将图像映射到真实世界坐标,但如果您不打算允许用户绘制路线,您可以调整引脚(MKAnnotations)坐标,使它们出现在您的正确位置地图。

There's a very good tutorial for what you're doing in the WWDC2010 example code. They take an image and cut it into quarters, and cut that into quarters and so on until the image tiles are manageable and then use a UIScrollView to show them off. No implementation of pins though. You could use an actual MKMapview and put the image in as as map tiles using the example from TileMaps (also from WWDC2010). You'd need to tag your image with coordinates, maybe turn it into GeoTiff, then run it through MapTiler. Quite how you map your image to real world coordinates I don't know, but if you're not planning on allowing the user to plot routes you can just adjust your pins' (MKAnnotations) coordinates so they appear on the right places of your map.

这篇关于如何制作具有自定义地图图像的类似地图的视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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