Tuesday, April 29, 2014

Line Modification

Tips for creating a line - like dropping points, freehand drawing and undo - were previously covered in this blog post.  Options for modifying existing lines have slowly been growing, and I think it's time to take a detailed look at them.

All of these options are accessed by right clicking on an existing line.  Vertex dragging is also enabled when clicking the edit icon in the left bar.

the right click context menu

The first option I want to cover is "Clone As".  This allows you turn a line into a polygon, add a styled line that matches a polygon border, or simply backup an existing line before editing or resampling:
right click -> Clone As -> Line.  Done.

Vertex dragging has been around for a while but it's worth a quick look.  Right click - > Modify -> Drag Vertices.

At this point each vertex along the line or polygon gets a draggable white circle.  Midpoints between vertices also get a partially transparent circle, which you can drag to create a new vertex.  To delete a point, right click on it and choose Delete Vertex.

When you're done modifying the line, right click on it and chose Save Changes - or, if you made a mistake, Discard Changes.

Sometimes it's useful to break a line in two - say to delete a bunch of points at once, or to get around a GPS' limitation on the number of points per route.  To do this, simply right click on a line at the point where you want it split, and choose Modify -> Split Here.

The opposite of splitting is joining.  To join lines,  one of the two must have a label.  Right click on the unlabeled line and choose Modify -> Join Lines.

A dialog will come up asking what line you want to join with.  If the two lines don't touch, CalTopo will automatically pick the best way to connect them.

Drawing a freehand line creates a lot of points.  This can exceed the limits of your GPS, resulting in only getting part of a route.  It also creates jitter, since no one has perfectly steady hands.  You can work around these problems by resampling a line, reducing the total number of points.

You can shrink a line down to a fixed number of points, or to create points at a fixed interval like 500 feet.  You can also optionally add a marker at each resampled point, in order to load them as waypoints onto a GPS.

Finally, you can reverse the order of a line so that directional styles will point in the opposite direction.

Friday, April 25, 2014

Line Styles

In a move that's been a long time coming, CalTopo now supports line styles.


When creating or editing a line, there's now a style option next to color, defaulting to solid.  Click on it to choose a line style.


A number of directional and nondirectional styles are provided, but if you'd like to see something specific, let me know.


Unfortunately, due to limitations in the Google Maps API, styles are not available on polygons.  Supplying polygon styles would mean dropping all the individual symbols on the map myself, which is doable from a technical perspective - that's how I support styles in the PDF generator and in the OpenLayers offline version - but might cause performance issues for large polygons.  It might get added at some point.

So what to do when you carefully draw a route and then realize you want the arrows to point in another direction?  Or when you want to add a line on top of a polygon boundary in order to style it?  That's the subject of the next blog post: line modification.

Thursday, April 24, 2014

Custom Map Layers

In the past, I've struggled with the balance between providing a wide range of map layers and keeping the layer list relevant for the majority of users.  The approach I originally adopted was to provide a large base list and a way to customize which layers were visible on the screen.

This turned out to be a bad idea all around.  It create a lot of work for me, most people never saw the customize link, and even those who did see it had no way of knowing if the list of available layers had changed.  Despite my best intentions, this was not the right way to expand CalTopo's support for regional or statewide map layers.

The almost-invisible layer customization link

The layer customization link is gone, as are some of the more obscure, little used map layers.  Instead, you can now add any tiled or WMS map source as a custom layer, and use it with almost all of CalTopo's features, including PDF generation and KMZ exports.  Start by clicking + Add New Layer in the left bar, and then Add Custom Source:


The two map types supported are tiled sources, which use Google Maps' tile pyramid structure popular with commercial map sources, and WMS, which is generally served up by government sites running some variation of ArcGIS.  The overlay property at the bottom of the dialog determines whether the layer shows up as a checkbox like the contour and fire history layers, or shows up in the standard layer dropdown with an opacity slider.


Max zoom applies to tiled layers only; many of these sources are supplied across a limited range of zoom levels (most of CalTopo's go to 16).  As long as this is set right, CalTopo will take over and automatically blow the source tiles up so you can keep zooming past this level.

This is all fairly advanced stuff.  For casual users, there's also a dropdown that auto-fills the form fields from a predefined layer list.  Currently this only has two options - the older USFS PBS maps and CalTopo's older Alaska-specific topo layer - but over time the list will grow to include datasources that don't meet the bar for inclusion in CalTopo's default list.

Beyond local and regional layers, I expect this will also include various federal government WMS datasources.

Wednesday, April 9, 2014

Cursor Elevation

CalTopo can now show the current cursor or center elevation under the coordinates at the top right (continental US only).  At least until I get any performance issues worked out, this is off by default - but you only have to turn it on once, as the choice is saved in a browser cookie.

Previously, you could hide the coordinate display at the top right by clicking on it.  This made it hard to copy coordinates, since selecting them with the cursor would also hide them.  I've removed this feature, and replaced it with a checkbox in the leftbar next to "Show Cursor/Center position":


Beneath that is a new option - "Include Elevation".  Check the box and the current elevation will automatically appear beneath the coordinates:


Elevation data is only retrieved after all the map tiles have finished loading, so when changing zoom or moving to a new location, there may be a short delay before it starts working again.