Permalink
Commits on Aug 9, 2010
  1. Use `zoomBy` to set zoom and center simultaneously.

    Mike Bostock
    Mike Bostock committed Aug 9, 2010
    Previously, the hash control would call `zoom` then `center`, which would
    trigger two move events. By using `zoomBy`, we coalesce these two steps into one
    move event, avoiding spurious tile loads. This is also important if, say, a
    listener sets the allowable zoom range based on the map center.
Commits on Aug 8, 2010
  1. Fix a crash when emptying the cache.

    Mike Bostock
    Mike Bostock committed Aug 8, 2010
    There was a bug in fixing the doubly-linked list when the last entry was removed
    from the cache. Thanks to Aaron Straup Cope for finding the bug!
Commits on Aug 6, 2010
  1. Add copyright notices to transform example.

    Mike Bostock
    Mike Bostock committed Aug 6, 2010
  2. Use stroke-opacity instead of rgba.

    Mike Bostock
    Mike Bostock committed Aug 6, 2010
  3. Make polymaps.min.js target writeable.

    Mike Bostock
    Mike Bostock committed Aug 6, 2010
    I'm leaving polymaps.js read-only, so that I don't accidentally edit polymaps.js
    when debugging. But when copying polymaps.min.js to another directory, it's
    useful for the file to be writeable so that I don't have to cp -f.
  4. Fix two bugs with proxy tiles.

    Mike Bostock
    Mike Bostock committed Aug 5, 2010
    With zoom transforms, it was possible for a proxy tile to be less than -4 or
    greater than +2 zoom levels from the map zoom level. This caused Polymaps to
    crash because the corresponding layer `g` element was missing. Now we properly
    shift the proxy zoom levels when a zoom transform is used.
    
    Another problem with proxy tiles is that we were accidentally doubling the proxy
    count for tiles along the viewport diagonal, per the new scanline algorithm. We
    now compute the correct proxy count, which is necessary so that the proxy tiles
    are removed when the referenced tiles load.
Commits on Aug 5, 2010
  1. Layer transforms!

    Mike Bostock
    Mike Bostock committed Aug 5, 2010
    Layers can now have associated affine transforms, affecting the layer's local
    tile coordinates. For example, this allows an individual layer to be rotated,
    scaled and translated within the map.
Commits on Aug 4, 2010
  1. Use scanline algorithm to determine visible tiles.

    Mike Bostock
    Mike Bostock committed Aug 4, 2010
    Previously, if the map were rotated, we would compute the axis-aligned bounding
    box to determine which tiles were visible. This is easy, but has the undesirable
    property that it can load (and display) many tiles that are inside the bounding
    box but outside the viewport.
    
    Now we use the triangle scanline algorithm to determine exactly which tiles are
    visible. The algorithm is modified slightly so that it displays any pixel (i.e.,
    tile) that intersects the triangle.
Commits on Aug 3, 2010
  1. Latitude clamping now considers map angle.

    Mike Bostock
    Mike Bostock committed Aug 3, 2010
  2. Improve stability of mousewheel interaction (again).

    Mike Bostock
    Mike Bostock committed Aug 3, 2010
    The previous fix suffered from two problems.
    
    First, redundant hashchange events are occasionally dispatched by the browser,
    and later events would not be ignored; thus the hash control would end up moving
    the map on map move. We avoid this now by caching the location hash, and only
    moving the map when the hash changes. This also allows us to ignore the
    hashchange event when the map moves.
    
    Second, the wheel control was caching the location under the mouse, and only
    updating it when the mouse moves. However, the map can move independently of the
    mouse, for example with arrow controls or animation. Thus, we now clear the
    cached location when the map moves. (And, we're careful to preserve the cached
    location when we zoom the map.)
  3. Don't hardcode the number of Bing tile servers.

    Mike Bostock
    Mike Bostock committed Aug 3, 2010
  4. Simplify overlay example using Layer.

    Mike Bostock
    Mike Bostock committed Aug 3, 2010
    We implement the static image overlay using a custom (but simple!) layer
    implementation that creates an image tile.
  5. Improve stability of mousewheel interaction.

    Mike Bostock
    Mike Bostock committed Aug 3, 2010
    Previously, the location under the mouse could drift as the mousewheel was used
    to zoom in and out. Now we compute the location under the mouse on mousemove, so
    that it does not drift when the map is zoomed. The location is specified as an
    optional third argument to `map.zoomBy`.
    
    The `map.panBy` method is reimplemented to be slightly faster and more accurate
    by avoiding an extra point <-> location conversion.
    
    Most importantly, the hash control now ignores the 'hashchange' event that it
    generates when it changes the hash. Previously, this was causing noticeable
    aliasing on smooth zoom as any movement of the map would be rounded to the
    precision of the hash control.
  6. Set cursor to "move" while dragging.

    Mike Bostock
    Mike Bostock committed Aug 3, 2010
Commits on Aug 2, 2010
  1. Rotation!

    Mike Bostock
    Mike Bostock committed Aug 2, 2010
    Maps can now be rotated using the `angle` property. For simplicity, the layer
    implementation currently computes the bounding box to fill the rotated viewport;
    in a future commit we will use a scanline fill algorithm to avoid loading tiles
    outside the viewport.
    
    This commit also fixes a bug in the `coordinatePoint` and `pointCoordinate`
    methods, which were treating points pre-fractional zoom. Now points are always
    considered to be in screen space (pixel coordinates), consistent with the
    `locationPoint` and `pointLocation` methods. Note, however, that the
    tile-specific projection used by layers is still pre-transform.
Commits on Jul 28, 2010
  1. New layer `visible` property.

    Mike Bostock
    Mike Bostock committed Jul 28, 2010
    A layer's visibility can now be toggled without adding or removing the layer
    from the map. This avoids inadvertantly changing the z-order of layers. In
    addition to removing the tiles from the SVG image, the layer container's
    visibility attribute is set to "hidden", such that if the user has extended the
    layer with additional elements, they become hidden as well.
Commits on Jul 27, 2010
  1. Refine the tile scale & rounding logic.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
    We now apply the scale transform to the layer group elements, rather than to
    each tile individually. In addition, rather than rounding each tile's position,
    we round the tileCenter coordinate.
  2. Fix zoom transforms with non-tiled layers.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
    Previously, if a zoom transform was used with a non-tiled layer, it could cause
    no tiles to be displayed. Now we guarantee that at least one (world-size) tile
    is visible.
  3. Improve performance of re-adding a layer.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
    Previously, when re-adding a layer to its map, the layer would be removed from
    the map only to be immediately added back. This prevents the browser from
    efficiently updating the display. Now we do the minimal amount of work, while
    still guaranteeing that layers appear in the order they were added.
  4. Fix a bug in event dispatch.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
    If an event listener is removed during an event dispatch, it shouldn't receive
    the active event. So now in addition to storing a defensive copy, we use a
    wrapper object for the event handler to store an `on` boolean. This is set to
    false when the listener is removed, preventing that handler from receiving the current event.
  5. Make a defensive copy of registered listeners.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
    This way, if a listener is removed while events are being dispatched, we won't
    inadvertantly skip a listener.
  6. Cache reference to map.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
    This way, if the layer is removed from the map by the time loaded tiles arrive,
    the map is still available for the purposes of projection.
  7. Add comment to point-coordinate methods.

    Mike Bostock
    Mike Bostock committed Jul 27, 2010
  8. Fix a spurious key repeat in arrow control.

    Mike Bostock
    Mike Bostock committed Jul 23, 2010
Commits on Jul 25, 2010
  1. Added Stamen to copyright

    Michal Migurski Michal Migurski
    Michal Migurski authored and Michal Migurski committed Jul 25, 2010
  2. Fixing the "logo" :)

    RandomEtc committed Jul 25, 2010
Commits on Jul 23, 2010
  1. Listen for hashchange events.

    Mike Bostock
    Mike Bostock committed Jul 23, 2010
    Now, when the location.hash changes, the map center and zoom will change
    accordingly. This is particularly nice for pasting in a URL that only differs by
    hash. Also, the hash control now ignores the hash if any part of it isNaN, or if
    it contains fewer than three components.
Commits on Jul 18, 2010
  1. Switch CloudMade API key.

    Mike Bostock
    Mike Bostock committed Jul 18, 2010
    Please get your own API key at http://cloudmade.com/register!
  2. Load State & County GeoJSON tiles from Google App Engine.

    Mike Bostock
    Mike Bostock committed Jul 18, 2010
  3. Ignore empty GeoJSON features.

    Mike Bostock
    Mike Bostock committed Jul 18, 2010
  4. Close Polygons, not MultiPolygons.

    Mike Bostock
    Mike Bostock committed Jul 18, 2010
  5. Don't callback for empty responses.

    Mike Bostock
    Mike Bostock committed Jul 18, 2010
    JSON.parse("") fails.
Commits on Jul 17, 2010
  1. Add lib/google-compiler.

    Mike Bostock
    Mike Bostock committed Jul 17, 2010
  2. Make Markdown happy.

    Mike Bostock
    Mike Bostock committed Jul 17, 2010