Friday, April 26, 2013

Freehand Drawing

Update: Based on user feedback I've swapped click-hold and shift-click-hold to better mimic the standard behavior.  Freehand drawing is now enabled through shift-click-hold; click-hold will drag the map as usual.

CalTopo now supports freehand drawing, allowing you to place lines by moving your mouse rather than individually dropping each point.  This required booting Google's drawing manager for my own, which always runs the risk of browser compatibility issues - so part of the reason for this post is simply to solicit bug reports of something seems amiss.

When drawing lines or polygons, you have the following options available:

  • click to add new points
  • click and hold to draw freehand segments
  • shift-click and hold to drag the map, since click and hold is now overridden
  • escape to undo drawing actions.  This will undo individual points one at a time or freehand sections in 50 point blocks.
It's now easier to draw wandering routes like this one

Thursday, April 25, 2013

Offline Maps With CalTopo To Go

As hinted at with the introduction of browser maps, you can now take CalTopo on the road, offline, without an internet connection.  Download maps ahead of time, edit them in the field, and then re-upload them when you hit civilization - or simply take some layered map goodness with you for offline viewing.

Step One: Save Maps to Your Browser.  See this post for details.

Step Two: Cache Map Tiles.  Go to http://caltopo.com/togo.  You'll get a rectangle select just like on the Print and KMZ Export pages.  Choose the area and zoom level you need, and check the layers you want to bring with you.

layer and zoom selection
Note that while there is a 1600 tile limit, the HTML5 Application Cache is a fragile beast.  Your browser may run out of space and throw an error before reaching 1600.  When you're ready, click the "Take This To Go" button:



You'll see "Processing . . ." for a while as the server builds up a cache manifest, and then a browser specific progress message.  When all the files are cached, you'll get an alert and be redirected to the offline page:


Step Three: Go Offline.  When you go offline, or when you just want to take it for a test drive, point your browser at http://caltopo.com/offline.  You'll get a simplified version of the CalTopo UI, using the OpenLayers map engine instead of Google Maps.

The simplifed CT2GO UI
The layer dropdown is limited to your cached layers

Some random thoughts and caveats:

  • This will not work with IE (9 and below) as it doesn't support HTML5 Application Caches.
  • This feature is both more fragile and harder to test than a standard online webapp.  Please send me bug reports if something doesn't work right.
  • Tile caching is currently limited to one rectangle at a time.
  • While it worked fine with an iPad, phone support is tricky, mostly because of the screen real estate required for the caching page.  I'll work on allowing you to draw a rectangle with your desktop and then cache it on your phone.
Enjoy!

Tuesday, April 23, 2013

One-Off and Browser Maps

I'm happy to announce a couple of long-overdue additions to CalTopo.  The first, one-off maps, allows you to create and share a map without tying it to your account.  You can also save maps to your browser using HTML5 local storage, which helps lay the groundwork for an offline version of CalTopo.  And, maps are now easier to delete/manage.

New Save Dialog

As the name suggests, One Off Maps let you create quick, single use maps you can email to a friend or post in a forum and then largely forget about.  If you're signed in when you create one, it will still be linked to your account so that you can make changes, but it won't show up under your map list.  If you don't want to sign in using OpenID, you can enter a password to allow future edits.

Browser Maps store data on your browser using HTML5 local storage.  They're not backed up to CalTopo, and there's no way to share them as the data only exists on your computer.  However, you can take them with you when you don't have internet access, and then transfer the data back to CalTopo later - more on this when offline maps are made public.  The browser map UI looks almost exactly the same as the standard map UI, except that the Share link is missing:


With one off and browser maps done, it was finally time to revisit the "Your Maps" screen.  There's now a second table showing your browser maps, and tools to copy maps between CalTopo and your browser:


When you click on the red X, you get two options: delete the map entirely, or turn it into a one-off map.  If you still want a link you sent people to work, but don't care about managing it through your account anymore, you can detach it and forget about it: