Adobe flash builder 4.6 IOS development-Offline Map

Source: Internet
Author: User

In mobile device development, because mobile networks are used and traffic issues need to be considered, it is a good solution to Use offline maps in map applications. Several necessary conditions for developing the offline map function.

 1. Image Source acquisition

Most of the images shown in the map are images. offline stores these images to the device, finds an algorithm, and loads the images. Image loading algorithms are tile algorithms.

Extended class. As mentioned above, Arcgis and Mapquest can be expanded.

The image source Acquisition Tool, mobile atlas creator, is an absolutely powerful tool that can be used to obtain image sources from different map servers, such as google and bingmap. Http://bbs.hiapk.com/thread-343851-1-1.html this post is about how to use, I then attached the tool, can run directly. There are many ways to save the image source here. I chose sqlite here, so that the image source is saved to the database. How does it become an image? I wrote a python script, it can be used to convert to an image. I will not go into details here.

2. Expand the map api. I will only post it here.

The principle is simple: Read the image from the app directory and display it.

Package com. google

{

Import com. dingli. model. ModelLocator;

Import flash.net. URLRequest;

/**
* Google offline map layer
*/
Public class GoogleOfflineLayer extends GoogleMayLayer
{
Private var dir: String;
Public function GoogleOfflineLayer ()
{
Super ();
Dir = "";
}

/**
* Construct the url of the offline Image
* @ Param level, Layer
* @ Param row, row
* @ Param col, column
* @ Return the url of the image
*
* The level is 17-level.
* Returns the map address and image address.
* Map address + row + "F" + col + "F" +level.png
*/
Override protected function getTileURL (level: Number, row: Number, col: Number): URLRequest
{
Var retUrl: URLRequest = new URLRequest ();
Var googleLevel: Number = 17-level;
Var url: String = col. toString () + "F" + row. toString () + "F" + googleLevel. toString () + ". png ";
Url = dir + "/" + url;
RetUrl. url = url;

// Debug
// RetUrl. url = "assets/ditu/2.png ";
Trace ("GoogleOfflineLayer. as line 46:" + url );

Return retUrl;
}
}
}

 

 

3. upload images to the device.

 

Ifiles or 91 assistant can be used to directly upload directories to devices. The premise is that the device must be jailbroken.

Offline map tool./Files/csharponworking/mobileatlascreator17sqlitegeographic chart .rar

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.