开发者

IPhone - Is it possible to add a Custom Image as the data source for a Map View?

开发者 https://www.devze.com 2023-02-09 05:46 出处:网络
I want to have a map view that loads from an image that I provide rather than using Google maps.This is basically because the internet will not be available where this app will be used.

I want to have a map view that loads from an image that I provide rather than using Google maps. This is basically because the internet will not be available where this app will be used.

I have heard that 开发者_StackOverflow中文版this is possible since map view is a CATiledLayer, so I should be able to provide custom content, but I am struggling to find information on the topic.

Could someone point me in the right direction?


You can't and doing this would be a violation of Google Map API terms. So Apple cannot even provide you such a feature. You must revert to third-party (and often non-free) services that use other maps.

The terms are here:

Google Maps API terms

This is a relevant (for this answer) extract from the terms:

  1. License Restrictions. Except as expressly permitted under the Terms, or unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), Google's licenses above are subject to your adherence to all of the restrictions below. Except as explicitly permitted in Section 7, you must not (nor may you permit anyone else to):

10.1 access or use the Service or any Content through any technology or means other than those provided in the Service, or through other explicitly authorized means Google may designate;

10.2 copy, translate, modify, create a derivative work of, or publicly display any Content or any part thereof (for example, the following are prohibited: (a) creating server-side modification of map tiles; and (b) stitching multiple static map images together to display a map that is larger than permitted in the Maps API Documentation);

10.3 pre-fetch, cache, or store any Content, except that you may store limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily, securely, and in a manner that does not permit use of the Content outside of the Service;

10.4 charge users or any other third party any incremental fee solely for the use of the Maps API Implementation, the Service, or the Content, unless you have entered into a separate written agreement with Google or obtained Google's written permission to do so (but if you are a consultant who creates or hosts Maps API Implementations for third party customers, you may charge such customers a fee for your consulting or hosting services); 10.5 reverse engineer, decompile or otherwise attempt to extract the source code of the Service or any part thereof, unless this is expressly permitted or required by applicable law;

10.6 use the Service in a manner that gives you or any other person access to mass downloads or bulk feeds of any Content, including but not limited to numerical latitude or longitude coordinates, imagery, and visible map data;

10.7 delete, obscure, or in any manner alter any warning, notice (including but not limited to any copyright or other proprietary rights notice), or link that appears in the Service or the Content;

10.8 use the Static Maps API other than in an implementation in a web browser;

10.9 use the Service or Content with any products, systems, or applications for or in connection with:

(a) real time navigation or route guidance, including but not limited to turn-by-turn route guidance that is synchronized to the position of a user's sensor-enabled device; (b) any systems or functions for automatic or autonomous control of vehicle behavior; or (c) dispatch, fleet management, business asset tracking, or similar enterprise applications (the Google Maps API can be used to track assets (such as cars, buses or other vehicles) as long as the tracking application is made available to the public without charge. For example, you may offer a free, public Maps API Implementation that displays real-time public transit or other transportation status information.


After some digging I found that this was not possible using a Map View

I ended up re-implementing a map view from a UIScroll View using a tiled layer as the content view. There is a tutorial how to do this in the 2010 WWDC videos on scroll views.

I then used open maps tiles.

This wasn't easy by any means. It took about a week to implement.

0

精彩评论

暂无评论...
验证码 换一张
取 消