Map form


Latitude/Longitude

Number of Tiles

Picture Size

Detail Scale (per inch)

Book Title

Book ShortTitle

Book ISBN

Include maps for tiles?

Next? Cache:process | Notes:display | CGI:process

Find forms

(Newton) City


Street Address

City,State Zip


City,Prov. Post.


Street Addr.(opt)

City Post.

Country


Latitude (decimal)

Longitude (dec.)

Introduction

This Newt's Cape example generates an HTML document with an overview map from MapBlast for a specified location, with navigation to more detailed maps. You can find this generator at: http://saweyer.freehostia.com/newton/newtscape/exs/makemap.htm.

A posting by Dave Miller on the NewtonTalk mailing list provided the initial idea, example and sample code. Dave wrote a : "Perhaps this will inspire [someone] to do something similar on the Newton. Maybe a plug-in for Newt's Cape?".

This could certainly be done as a plugin, or might be built-in to Newt's Cape, perhaps similar to how Notes' "Newt's Cape:Find" uses AltaVista or other search engines. An HTML document with embedded NewtonScript is more flexible/fun to create than a separate application or plugin, allows me to stress test Newt's Cape in new ways, and allows others to see and customize what I've done, perhaps inspiring other map or server interfaces. I borrowed from Dave's versions (preserving variable names and comments where possible), and incorporated other Newt's Cape examples, e.g., location.htm for LatLong and City pickers. After I released my first makemap, feedback/suggestions flowed back and forth, Dave created a map page with Perl CGI script, and I created this second Newt's Cape version.

Other map options

Revision History

Future?

6 Dec 99

11 Nov 98

2 Nov 98


Map form | Find forms | Help

Help

Notes:

Map form

Use Map form if you know the latitude/longitude in degrees and minutes, or once you have set it via one of the Find forms.

Latitude/Longitude
If you know this, you can set it directly via a latitude/longitude picker, or set via Find forms. If this appears as a regular text entry field, you forgot to turn on NewtonScript:Compile preference!
Number of Tiles
default: 9. number of squares in overview with more detailed maps
Picture Size
default: MP2K portrait; MP130 landscape (= 320). specifies how many pixels across/down in the bitmap. Depending on screen size and orientation, you may see a 2D control for scrolling an individual map on a page. These sizes optimize screen width to avoid scrolling; you can get more detail by increasing number of tiles.
Detail Scale
default: 1" = 1/2 mi. how much area to show per inch in detailed map; overview map scale is a multiple of number of rows.
Book Title
default: Map: city, region; country. title appears at the top of each book page.
Book ShortTitle
default: limited to ~18 characters. icon label if you Save as Package to Extras.
Book ISBN
default: 12 characters of city, 2 characters of region. maximum of 14 characters. unique identifier for the book.
Include maps for tiles?
default: on -- creates an image map for each tile (center circle for overview; triangles for adjacent 4 tiles). While you are modifying parameters to get the right location and scale, you might want to turn this off to speed up generation and processing. This may especially be desirable if you have a large number of tiles (>= 25) and are using a version of Newt's Cape <= 2.0e. Once you have the images you want, you can turn this on to generate the longer version (and re-use cached images, assuming other parameters are identical) . (this option always on for CGI currently).
Next? Cache:process | Notes:display | CGI:process
default: off
if on for Notes, open Notes application and display source.
if on for Cache or CGI, after saving source to HTML Cache, Newt's Cape processes the document using its current i:Process setting, and other user preferences, though temporarily turning on "autoload?" and turning off "scale to fit?".
Save to HTML Cache
save source to HTML Cache. If Next? Cache:process checked, automatically load images and display document.
Save HTML to Notes
save source to Notes. If Next? Notes:display checked, automatically opens Notes. This might be useful for debugging, or transferring source to desktop or other Newton (email,beam) -- though you could use parameters to re-create the source using this form. Note: although Newt's Cape can Open this document from Notes (and include any cached images), this does not currently support View:Load with Images
Dave's CGI Script
since this form collects basically the same input as Dave Miller's maptiler form, you could generate HTML using his server script. This is mostly for testing/interest, since local generation (e.g., Save to HTML Cache) creates HTML more quickly and more optimized for Newt's Cape. If Next? CGI:process is checked, Newt's Cape processes the document after querying and caching the result.
Write to NTK Inspector
Source appears in NTK Inspector (or other debugging tool) via the Write function. This mostly for testing, but could be useful for testing changes or to transfer source quickly to desktop to view in a desktop browser.

Find forms

If you know the latitude/longitude of your destination in degrees and minutes, you can go directly to the Map form. Otherwise, go to Find forms; these will typically set the latitude and longitude for you, along with default values for Title, ShortTitle and ISBN. There are 5 separate forms:

(Newton) City
pick it from the local Newton city/country picker at top -- this defaults to your current location. if this appears as regular text entry field, you forgot to turn on NewtonScript:Compile preference.
US address, city, state, zip
tap US MapBlast!; Newt's Cape connects to/queries MapBlast web site; if it's successful/unique, Newt's Cape automatically extracts&fills-in the latitude/longitude and other information; otherwise, it pops up an error box. Since a result document is ~20K, this can take a minute to query, transfer and parse.
Canadian city, province
tap: Canadian MapBlast!. same process as US
world city (country optional)
tap WorldBlast!. same process as US
latitude/longitude (decimal)
if you have lat/long in decimal degrees, e.g., from your own search of MapBlast or other map site, enter these and tap Convert to convert/copy to the Map form

Using the Maps

This assumes some familiarity with Newt's Cape and with the Newton book viewer.

If you selected Save HTML to Notes, you can use File:Open Notes in Newt's Cape to view the document without graphics, experiment with text-based links, or edit or email the source.

Otherwise, you selected Save to HTML Cache. If beforehand you checked Next? Cache:process, the graphics should have loaded automatically. Otherwise, you would need to either select command: "View:Load with Images" or turn on Newt's Cape preference: "i:General:Images:autoload?" (and reselect the map document from cache).

To navigate among maps, it's best to start with the Overview map on page 1. You can reach the Overview by tapping:

Earlier, you specified a number of tiles. The overview map is divided into that many squares. Tap on a square to "zoom in" to that detailed map.

When you are at a detailed map, tapping the heading title returns to overview. If Include maps for tiles? was off, tapping on the detail map does nothing. If maps were included, tap the center (approx. 1/2 inch diameter) to "zoom out" to the overview. "Scroll" to an adjacent map (if available) via triangles on top,left,right,bottom, i.e.,

 \ N /
  \ /
W  O  E
  / \
 / S \

You can re-create the map book each time, from document and images in cache. For frequently accessed maps, you can save the book as a package. Assuming NewtPack plugin is installed, you select File:Save as Package to save the current temporary book to Extras. After checking that the book appears and works properly, you can remove the document source from the HTML Cache, and the overview and detailed maps from the Image Cache. I would not recommend distributing these packages since there are likely copyright problems beyond personal use.


Map form | Find forms | Introduction

This document (in all its formats) is ©1998-2004. Steve Weyer. All Rights Reserved Worldwide. You are free to incorporate this into your own documents, but I would appreciate an acknowledgement of Newt's Cape and makemap.

Last updated: Dec 2000