cschamp/Terremoto

语言: Objective-C

git: https://github.com/cschamp/Terremoto

iOS 6演示使用USGS地震信息和MapKit
iOS 6 demo using USGS earthquake info and MapKit
README.md (中文)

地震 =========

Terremoto是我在iPhone编程中编写的一个示例iPhone应用程序。



实施概述

此iOS 6应用程序使用NSXMLParser从USGS网站获取和解析地震信息。然后使用MapKit在世界地图上绘制地震。

网络和应用商店中有几个类似的应用。 Apple有示例代码来显示NSXMLParser的使用,但该代码在没有地图的UITableView中以任意顺序显示地震。

另一个类似的应用是Bill Dudney在Pragmatic Programmers的截屏和示例代码。 Terremoto(我的应用程序)中的代码目前几乎逐字地使用Dudney的XML解析器代码(经过许可)。我的视图控制器类似于Dudney,因为我从他的代码中学到了很多方法,但是随着时间的推移,我的视图控制器代码已经采取了自己的方向。我的应用程序Terremoto与Dudney的不同之处在于Terremoto显示从USGS站点获取的所有地震事件,而不仅仅是距离用户所在位置最近的50或100。这需要改变Terremoto缩放到用户当前位置的方式等。我的应用程序还在应用程序内的UIWebView中显示有关地震的详细信息,而Dudney的演示应用程序通过在USGS URL上启动Safari来显示此信息。

我计划使用自定义注释视图在地图上显示地震,类似于USGS网站本身的地图,其中事件不是以彩色编码的针脚显示,而是以不同大小和颜色的方块显示。我还想添加一个控件,以允许用户随时缩放到当前位置。我计划添加的另一个功能是首先显示最近的地震,或者将最近的地震作为初始变焦位置,或者可能添加一个视图,显示按事件时间或大小排序的列表中的地震。

克雷格·尚普

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md


Terremoto
=========

Terremoto is a sample iPhone application that I wrote as an exercise in iPhone programming.



Implementation Overview

This iOS 6 application uses NSXMLParser to fetch and parse earthquake information from the USGS web site. It then plots the earthquakes on a world map using MapKit.

There are several similar apps on the web and in the app store. Apple has sample code to show the use of the NSXMLParser, but that code displays the earthquakes in arbitrary order in a UITableView with no map.

Another similar application is from Bill Dudney's screencast and sample code at Pragmatic Programmers. The code in Terremoto (my application) uses Dudney's XML parser code (with permission) almost verbatim at present. My view controller is similar to Dudney's, since I learned from his code and there are only so many ways to do this, although over time my view controller code has taken its own direction. Among the ways my app, Terremoto, differs from Dudney's is that Terremoto displays all earthquake events fetched from the USGS site, not just the 50 or 100 nearest to the user's location. This requires changes in the way Terremoto zooms to the user's current location, among other things. My application also displays details about the earthquake in a UIWebView within the application, whereas Dudney's demo app displayed this information by launching Safari on a USGS URL.

I plan to show earthquakes on the map using a custom annotation view to resemble the maps on the USGS web site itself, where events are displayed not as color-coded pins, but as squares of varying sizes and colors. I also want to add a control to allow the user to zoom to the current location at any time. Another feature I plan to add is one that will show the most recent earthquakes first, perhaps making a recent earthquake the initial zoom location, or perhaps adding a view that shows the earthquakes in a list sorted by time of the event or by magnitude.

Craig Schamp