{"version":3,"sources":["canvas.coffee","dem.coffee","features.coffee","location.coffee","note.coffee","region.coffee","scale.coffee","symbol.coffee","utils.coffee"],"names":[],"mappings":"AAAA;EAAA,GAAG,CAAC,MAAJ,GAAa,SAAC,OAAD;AACX,QAAA;IAAA,GAAA,GAAM,OAAO,CAAC;IACd,IAAA,GAAO,GAAG,CAAC,EAAE,CAAC;IACd,GAAG,CAAC,KAAK,CAAC,WAAV,GAAwB;IAExB,MAAA,GAAS;IAET,MAAA,GAAS;MACP,CAAA,EAAG,EAAE,CAAC,GAAH,CAAO,CAAC,CAAC,IAAK,CAAA,CAAA,CAAP,EAAW,IAAK,CAAA,CAAA,CAAhB,CAAP,CAAA,GAA8B,CAD1B;MAEP,CAAA,EAAG,EAAE,CAAC,GAAH,CAAO,CAAC,CAAC,IAAK,CAAA,CAAA,CAAP,EAAW,IAAK,CAAA,CAAA,CAAhB,CAAP,CAAA,GAA8B,CAF1B;;IAKT,IAAA,GAAO,GAAG,CAAC,IAAJ,GAAW,KAAA,CAAM,GAAG,CAAC,EAAE,CAAC,UAAb;IAClB,GAAG,CAAC,aAAJ,GAAoB,SAAC,CAAD;AAAO,UAAA;MAAA,MAAS,IAAI,CAAC,OAAL,CAAa,CAAb,CAAT,EAAC,UAAD,EAAI;AAAsB,aAAO,CAAC,CAAC,CAAF,EAAK,CAAC,CAAN;IAAxC;IAEpB,UAAA,GAAa,GAAG,CAAC,UAAJ,GAAiB,SAAC,GAAD;AAAY,UAAA;MAAV,YAAG;aAAO,CACxC,CAAC,CAAA,GAAI,IAAK,CAAA,CAAA,CAAV,CAAA,GAAgB,GAAG,CAAC,EAApB,GAAyB,GAAG,CAAC,EAAG,CAAA,CAAA,CADQ,EAExC,CAAC,IAAK,CAAA,CAAA,CAAL,GAAU,CAAX,CAAA,GAAgB,GAAG,CAAC,EAApB,GAAyB,GAAG,CAAC,EAAG,CAAA,CAAA,CAFQ;IAAZ;IAK9B,UAAU,CAAC,MAAX,GAAoB,SAAC,GAAD;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IAAL,CAAU,GAAV,EAAb;;AACA,iBAHF;;MAIA,EAAA,GAAK,KAAM,CAAA,CAAA,CAAN,GAAW,IAAK,CAAA,CAAA;MACrB,EAAA,GAAK,KAAM,CAAA,CAAA,CAAN,GAAW,IAAK,CAAA,CAAA;MACrB,KAAA,GAAQ,IAAI,CAAC,IAAL,CAAU,EAAA,GAAG,EAAH,GAAQ,EAAA,GAAG,EAArB;MACR,IAAG,IAAH;QAAa,KAAK,CAAC,IAAN,CAAW,GAAA,IAAO,KAAlB,EAAb;;MACA,IAAA,GAAO;AATT;AAWA,WAAO;EAfI;;EAkBb,GAAG,CAAC,KAAJ,GAAY,SAAC,MAAD,EAAS,QAAT;AACV,QAAA;IAAA,IAAA,GAAO;AACP,SAAA,wCAAA;;MACE,IAAO,YAAP;QACE,IAAA,GAAO;AACP,iBAFF;;MAGA,IAAG,KAAM,CAAA,CAAA,CAAN,IAAY,QAAf;QACE,CAAA,GAAI,CAAC,QAAA,GAAW,IAAK,CAAA,CAAA,CAAjB,CAAA,GAAuB,CAAC,KAAM,CAAA,CAAA,CAAN,GAAW,IAAK,CAAA,CAAA,CAAjB;QAC3B,EAAA,GAAK,KAAM,CAAA,CAAA,CAAN,GAAW,IAAK,CAAA,CAAA;QACrB,EAAA,GAAK,KAAM,CAAA,CAAA,CAAN,GAAW,IAAK,CAAA,CAAA;QACrB,MAAA,GAAS,CAAC,IAAK,CAAA,CAAA,CAAL,GAAU,EAAA,GAAK,CAAhB,EAAmB,IAAK,CAAA,CAAA,CAAL,GAAU,EAAA,GAAK,CAAlC;AACT,eAAO;UACL,QAAA,EAAU;YACR,IAAA,EAAM,OADE;YAER,WAAA,EAAa,MAFL;WADL;UALT;;MAWA,IAAA,GAAO;AAfT;EAFU;AA7BZ","file":"ui.js","sourceRoot":"/source/","sourcesContent":["app.canvas = (options) ->\n map = options.map\n bbox = map.db.bbox\n map.debug.coordinates = false\n\n canvas = {}\n\n extent = {\n w: d3.max([-bbox[0], bbox[2]]) * 2\n h: d3.max([-bbox[1], bbox[3]]) * 2\n }\n\n proj = map.proj = proj4(map.db.projParams)\n map.wgsProjection = (p) -> [x, y] = proj.forward(p); return [+x, +y]\n\n projection = map.projection = ([x, y]) -> [\n (x - bbox[0]) * map.sc + map.tr[0]\n (bbox[3] - y) * map.sc + map.tr[1]\n ]\n\n projection.invert = ([px, py]) -> [\n bbox[0] + (px - map.tr[0]) / map.sc\n bbox[3] - (py - map.tr[1]) / map.sc\n ]\n\n projection.stream = (s) -> {\n point: (x, y, z) -> [px, py] = projection([x, y]); s.point(px, py, z)\n sphere: -> s.sphere()\n lineStart: -> s.lineStart()\n lineEnd: -> s.lineEnd()\n polygonStart: -> s.polygonStart()\n polygonEnd: -> s.polygonEnd()\n valid: true\n }\n\n zoom = d3.behavior.zoom()\n\n simplify = d3.geo.transform(\n point: (x, y, z) ->\n if z? and z >= 300 / map.sc\n return @stream.point(x, y)\n )\n\n clip = d3.geo.clipExtent()\n\n map.path = d3.geo.path()\n .projection(stream: (s) -> simplify.stream(clip.stream(projection.stream(s))))\n\n mapLayer = d3.select('body').append('svg').attr('class', 'mapLayer')\n canvas.actionbar = d3.select('body').append('svg')\n .attr('class', 'actionbar')\n .attr('height', app.ACTIONBAR_HEIGHT)\n\n app.symbol.defs(mapLayer.append('defs'))\n\n canvas.land = mapLayer.append('g')\n canvas.contours = mapLayer.append('g')\n canvas.features = mapLayer.append('g')\n canvas.symbols = mapLayer.append('g')\n canvas.locationg = mapLayer.append('g').attr('class', 'location')\n\n d3.select('body').call(zoom)\n document.querySelector('svg.mapLayer').addEventListener('touchstart', (e) -> e.preventDefault())\n\n resize = ->\n if map.sc?\n oldCenter = [map.width / 2, map.height / 2]\n\n map.width = parseInt(d3.select('body').style('width'))\n map.height = parseInt(d3.select('body').style('height'))\n minScale = d3.min([map.width / extent.w, map.height / extent.h])\n\n if map.sc?\n sc = map.sc\n tr = map.tr\n center = projection.invert(oldCenter)\n\n else\n sc = minScale\n tr = [0, 0]\n center = [0, 0]\n\n updateProjection(sc, tr)\n zoom.scaleExtent([minScale, 3])\n\n map.centerAt(center, map.sc)\n resetMap()\n\n updateProjection = (new_sc, new_tr) ->\n map.sc = new_sc\n map.tr = new_tr\n\n [x0, y0] = projection.invert([0, map.height])\n [x1, y1] = projection.invert([map.width, 0])\n clip.extent([\n [d3.max([x0, bbox[0]]), d3.max([y0, bbox[1]])]\n [d3.min([x1, bbox[2]]), d3.min([y1, bbox[3]])]\n ])\n\n resetMap = ->\n transformMap((map.scBase = map.sc), (map.trBase = map.tr))\n\n transformMap = (scZoom, trZoom) ->\n scDelta = scZoom / map.scBase\n trDelta = [\n trZoom[0] - map.trBase[0] * scDelta + (scDelta - 1) * map.width / 2\n trZoom[1] - map.trBase[1] * scDelta + (scDelta - 1) * map.height / 2\n ]\n transform = \"translate3d(#{trDelta[0]}px,#{trDelta[1]}px,0px)\n scale(#{scDelta})\"\n style = \"-webkit-transform: #{transform};\n transform: #{transform}\"\n\n mapLayer.attr('style', style)\n\n if map.debug.coordinates\n mapLayer.on 'mousemove', ->\n console.log(proj.inverse(projection.invert([d3.event.x, d3.event.y])))\n else\n mapLayer.on 'mousemove', ->\n\n map.centerAt = (pos, new_sc) ->\n updateProjection(new_sc, [0, 0])\n xy = projection(pos)\n new_tr = [map.width / 2 - xy[0], map.height / 2 - xy[1]]\n zoom.scale(new_sc).translate(new_tr)\n updateProjection(new_sc, new_tr)\n map.dispatch.redraw()\n\n zoom.on 'zoom', ->\n map.zooming = true\n updateProjection(d3.event.scale, d3.event.translate)\n transformMap(d3.event.scale, d3.event.translate)\n map.dispatch.zoom()\n\n zoom.on 'zoomend', ->\n map.zooming = false\n resetMap()\n map.dispatch.zoomend()\n\n d3.select(window).on('resize.canvas', resize)\n map.dispatch.on('ready.canvas', resize)\n\n return canvas\n","app.dem = (options) ->\n map = options.map\n contours = options.contours\n\n contourLayer = topojson.feature(map.db.dem, map.db.dem.objects.contour).features\n\n contours.selectAll('.contour')\n .data(contourLayer)\n .enter().append('path')\n .attr('class', 'contour')\n .classed('contour-minor', (d) -> d.properties.elevation % 300)\n .attr('id', (d) -> \"contour-#{d.id}\")\n\n renderContours = ->\n contours.selectAll('.contour')\n .attr('d', map.path)\n\n contours.selectAll('.contour-label').remove()\n\n for ring in contourLayer\n continue if ring.properties.elevation % 300\n contours.append('text')\n .attr('class', 'contour-label')\n .append('textPath')\n .attr('xlink:href', \"#contour-#{ring.id}\")\n .attr('startOffset', \"50%\")\n .text(ring.properties.elevation)\n\n map.dispatch.on('redraw.contours', renderContours)\n map.dispatch.on('zoomend.contours', renderContours)\n","app.features = (options) ->\n map = options.map\n db = map.db\n map.debug.collisions = false\n\n land = options.landG.append('g')\n lakes = options.featuresG.append('g')\n rivers = options.featuresG.append('g')\n highways = options.featuresG.append('g')\n segments = options.featuresG.append('g')\n symbols = options.symbols\n\n lakesLayer = topojson.feature(db.topo, db.topo.objects.lakes).features\n segmentLayer = topojson.feature(db.topo, db.topo.objects.segments).features\n segmentMap = app.index(segmentLayer)\n for s in segmentLayer\n s.properties.length = app.length(s.geometry.coordinates, true)\n\n poiLayer = topojson.feature(db.topo, db.topo.objects.poi).features\n riversLayer = topojson.feature(db.topo, db.topo.objects.rivers).features\n highwaysLayer = topojson.feature(db.topo, db.topo.objects.highways).features\n\n landLayer = topojson.feature(db.land, db.land.objects.land).features\n\n for route in db.routes\n for id in route.segments\n if route.symbol?\n segment = segmentMap.get(id)\n segment.properties.symbols = [] unless segment.properties.symbols?\n segment.properties.symbols.push(route.symbol)\n\n labelWidthG = symbols.append('g')\n .attr('class', 'symbolLabel')\n .attr('tarnsform', 'translate(0,-100)')\n app.symbol.calculateLabelWidth(labelWidthG, poiLayer)\n labelWidthG.remove()\n\n land.selectAll('.landPoly')\n .data(landLayer)\n .enter().append('path')\n .attr('class', (d) -> \"landPoly land-#{d.properties.type}\")\n .attr('id', (d) -> d.id)\n\n segments.selectAll('.segment')\n .data(segmentLayer)\n .enter().append('path')\n .attr('class', 'segment')\n .attr('id', (d) -> d.id)\n\n lakes.selectAll('.lake')\n .data(lakesLayer)\n .enter().append('path')\n .attr('class', 'lake')\n .attr('id', (d) -> d.id)\n\n rivers.selectAll('.river')\n .data(riversLayer)\n .enter().append('path')\n .attr('class', 'river')\n .attr('id', (d) -> d.id)\n\n highways.selectAll('.highway')\n .data(highwaysLayer)\n .enter().append('path')\n .attr('class', (d) -> \"highway highway-#{d.properties.grade}\")\n .attr('id', (d) -> d.id)\n\n render = ->\n land.selectAll('.landPoly')\n .attr('d', map.path)\n\n segments.selectAll('.segment')\n .attr('d', map.path)\n\n lakes.selectAll('.lake')\n .attr('d', map.path)\n\n rivers.selectAll('.river')\n .attr('d', map.path)\n\n highways.selectAll('.highway')\n .attr('d', map.path)\n\n symbols.selectAll('.symbol').remove()\n symbols.selectAll('.symbolLabel').remove()\n\n interval = 80 / map.sc\n symbolList = []\n for segment in segmentLayer\n length = segment.properties.length\n for n in d3.range(0, d3.round(length / interval))\n point = app.along(segment.geometry.coordinates, interval * (n + 0.5))\n if segment.properties.symbols\n point.properties = {symbols: segment.properties.symbols}\n if app.inside(point.geometry.coordinates, db.bbox)\n xyproj = map.projection(point.geometry.coordinates)\n x = d3.round(xyproj[0])\n y = d3.round(xyproj[1])\n if app.inside([x, y], [0, 0, map.width, map.height])\n symbol = {\n segmentSymbol: true\n properties: point.properties\n x: x\n y: y\n hw: 6.5 * segment.properties.symbols.length\n hh: 6.5\n }\n symbolList.push(symbol)\n\n for poi in poiLayer\n xyproj = map.projection(poi.geometry.coordinates)\n x = d3.round(xyproj[0])\n y = d3.round(xyproj[1])\n if x > 0 and x < map.width and y > 0 and y < map.height\n if (symbolType = app.symbol[poi.properties.type])?\n symbol = {\n id: poi.id\n properties: poi.properties\n x: x\n y: y\n hw: symbolType.mask.hw\n hh: symbolType.mask.hh\n }\n symbolList.push(symbol)\n\n symbols.selectAll('.symbol')\n .data(symbolList)\n .enter().append('g')\n .attr('id', (d) -> d.id)\n .attr('class', 'symbol')\n .attr('transform', (d) -> \"translate(#{d.x},#{d.y})\")\n .each(app.symbol.render)\n\n qt = (d3.geom.quadtree()\n .extent([[0, 0], [map.width, map.height]])\n .x (d) -> d.x\n .y (d) -> d.y\n )([])\n\n # search distance\n sw = d3.max(symbolList, (s) -> s.hw)\n sh = d3.max(symbolList, (s) -> s.hh)\n\n collides = (x, y, hw, hh) ->\n tx1 = x - hw - sw\n ty1 = y - hh - sh\n tx2 = x + hw + sw\n ty2 = y + hh + sh\n hit = false\n qt.visit (quad, qx1, qy1, qx2, qy2) ->\n if (point = quad.point)?\n dx = Math.abs(point.x - x)\n dy = Math.abs(point.y - y)\n if dx < hw + point.hw and dy < hh + point.hh\n hit = true\n return qx1 > tx2 or qx2 < tx1 or qy1 > ty2 or qy2 < ty1\n return hit\n\n for symbol in symbolList.slice().reverse()\n continue if symbol.segmentSymbol\n size = symbol.properties.labelSize\n mask = app.symbol[symbol.properties.type].mask\n thw = size.w / 2\n thh = size.h / 2\n tx = symbol.x + mask.hw + thw + 1\n ty = symbol.y + mask.hh - 2 * thh\n unless collides(tx, ty, thw + 1, thh + 1)\n if (name = symbol.properties.name)?\n g = symbols.append('g')\n .attr('class', 'symbolLabel')\n .attr('transform', \"translate(#{tx - thw},#{ty - thh - size.dy})\")\n .attr('for', symbol.id)\n app.symbol.textWithHalo(g, name)\n qt.add(x: tx, y: ty, hw: thw, hh: thh, labelFor: symbol)\n\n if map.debugCollisions\n qtNodes = []\n qt.visit((node) -> if node.point then qtNodes.push(node.point); true)\n symbols.selectAll('.quadtreeRect').data(qtNodes)\n .enter().append('rect')\n .attr('class', 'symbol quadtreeRect')\n .attr('x', (d) -> d.x - d.hw)\n .attr('y', (d) -> d.y - d.hh)\n .attr('width', (d) -> d.hw * 2)\n .attr('height', (d) -> d.hh * 2)\n .attr('fill', 'none')\n .attr('stroke-width', 1)\n .attr('stroke', 'red')\n\n map.dispatch.on 'redraw.features', ->\n render()\n\n map.dispatch.on 'zoomend.features', ->\n render()\n","ACCURACY_LIMIT = 1000 # 1km\nLOCATION_OFF = 0\nLOCATION_WAIT = 1\nLOCATION_SHOW = 2\nLOCATION_TRACK = 3\n\napp.location = (options) ->\n map = options.map\n locationg = options.locationg\n button = options.locationbuttong\n\n location = null\n locationMode = null\n locationWatch = null\n\n locationg.append('circle')\n .attr('class', 'midpoint')\n .attr('r', 6)\n\n locationg.append('circle')\n .attr('class', 'accuracy')\n\n setMode = (mode) ->\n locationMode = mode\n button.attr 'class', switch locationMode\n when LOCATION_OFF then 'locationbutton'\n when LOCATION_WAIT then 'locationbutton waiting'\n when LOCATION_SHOW then 'locationbutton showing'\n when LOCATION_TRACK then 'locationbutton showing tracking'\n\n setMode(LOCATION_OFF)\n\n button.append('rect')\n .attr('class', 'buttonmask')\n .attr('x', -25)\n .attr('y', -25)\n .attr('width', 50)\n .attr('height', 50)\n\n button.on 'click', ->\n switch locationMode\n when LOCATION_OFF\n setMode(LOCATION_WAIT)\n locationWatch = navigator.geolocation.watchPosition(positionOk, positionHide, enableHighAccuracy: true)\n\n when LOCATION_WAIT\n setMode(LOCATION_OFF)\n navigator.geolocation.clearWatch(locationWatch)\n\n when LOCATION_SHOW\n setMode(LOCATION_TRACK)\n positionUpdate()\n\n when LOCATION_TRACK\n setMode(LOCATION_OFF)\n navigator.geolocation.clearWatch(locationWatch)\n positionHide()\n\n app.symbol.locationbutton(button)\n\n showLocation = () ->\n if map.zooming\n return\n\n unless location?\n locationg.style('display', 'none')\n return\n\n xy = map.projection(map.wgsProjection(location.pos))\n locationg.style('display', null)\n .attr('transform', \"translate(#{xy})\")\n\n locationg.select('.accuracy')\n .attr('r', d3.max([location.accuracy * map.sc, 8]))\n\n map.dispatch.on 'zoom.location', ->\n positionDisableTracking()\n\n map.dispatch.on 'zoomend.location', ->\n showLocation()\n\n map.dispatch.on 'redraw.location', ->\n showLocation()\n\n positionOk = (evt) ->\n coords = evt.coords\n return if coords.accuracy > ACCURACY_LIMIT\n pos = [coords.longitude, coords.latitude]\n return unless app.inside(map.wgsProjection(pos), map.db.bbox)\n location = {pos: pos, accuracy: coords.accuracy}\n\n center = false\n if locationMode == LOCATION_WAIT\n setMode(LOCATION_SHOW)\n center = true\n positionUpdate(center)\n\n positionUpdate = (center) ->\n showLocation()\n if (locationMode == LOCATION_TRACK or center) and location\n point = map.wgsProjection(location.pos)\n if app.inside(point, map.db.bbox)\n scaleTarget = d3.min([map.width, map.height]) / 3 / location.accuracy\n scale = d3.min([scaleTarget, 3])\n map.centerAt(point, scale)\n\n positionDisableTracking = ->\n if locationMode == LOCATION_TRACK\n setMode(LOCATION_SHOW)\n\n positionHide = ->\n location = null\n showLocation()\n","app.note = (options) ->\n map = options.map\n\n btn = options.g.append('a')\n .attr('xlink:href', '#')\n\n btn.append('circle')\n .attr('r', 17)\n\n btn.append('text')\n .attr('transform', \"translate(-3,5)\")\n .text('!')\n\n render = ->\n lngLat = map.proj.inverse(\n map.projection.invert(\n [map.width / 2, map.height / 2])\n ).map(d3.format('.05f'))\n\n url = 'mailto:haihui@grep.ro?subject=Map%20note&body=' +\n encodeURIComponent('Location: ' + lngLat.join('/') + '\\n\\n\\n')\n\n btn.attr('xlink:href', url)\n\n map.dispatch.on 'zoomend.note', ->\n render()\n\n map.dispatch.on 'redraw.note', ->\n render()\n","app.ACTIONBAR_HEIGHT = 50\n\n\ninitialize = (db) ->\n map = {\n db: db\n dispatch: d3.dispatch('ready', 'zoom', 'zoomend', 'redraw')\n debug: {}\n }\n\n topojson.presimplify(db.topo)\n topojson.presimplify(db.land)\n topojson.presimplify(db.dem)\n\n canvas = app.canvas(map: map)\n\n actionbarRight = canvas.actionbar.append('g')\n\n scaleg = actionbarRight.append('g')\n .attr('class', 'scale')\n .attr('transform', \"translate(85.5, 15)\")\n\n locationbuttong = actionbarRight.append('g')\n .attr('class', 'locationbutton')\n .attr('transform', \"translate(60, #{app.ACTIONBAR_HEIGHT / 2})\")\n\n# noteG = actionbarRight.append('g')\n# .attr('class', 'note')\n# .attr('transform', \"translate(0, #{app.ACTIONBAR_HEIGHT / 2})\")\n\n\n meteoG = actionbarRight.append('g')\n .attr('transform', \"translate(-10, 3)\")\n .attr('class', \"meteobutton\")\n\n meteoG.append('a')\n .attr('xlink:href', db.meteoLink)\n .attr('target', \"_blank\")\n .append('image')\n .attr('xlink:href', '../meteoblue-logo.png')\n .attr('height', app.ACTIONBAR_HEIGHT - 6)\n .attr('width', app.ACTIONBAR_HEIGHT - 6)\n\n\n canvas.actionbar\n .append('text')\n .attr('class', 'logo')\n .attr('transform', \"translate(#{5},#{app.ACTIONBAR_HEIGHT / 2 + 8})\")\n .append('a')\n .attr('xlink:href', '..')\n .text('haihui')\n\n\n\n\n placeActionbarRight = ->\n width = parseInt(d3.select('body').style('width'))\n actionbarRight.attr('transform', \"translate(#{width - 250},0)\")\n\n placeActionbarRight()\n d3.select(window).on('resize.placeActionbarRight', placeActionbarRight)\n\n app.location(\n map: map\n locationg: canvas.locationg\n locationbuttong: locationbuttong\n )\n\n app.dem(\n map: map\n contours: canvas.contours\n )\n\n app.scale(\n map: map\n scaleg: scaleg\n )\n\n app.features(\n map: map\n featuresG: canvas.features\n landG: canvas.land\n symbols: canvas.symbols\n )\n\n# app.note(\n# map: map\n# g: noteG\n# )\n\n d3.select('.splash').remove()\n map.dispatch.ready()\n return map\n\n\napp.load = (url) ->\n d3.json url, (error, db) ->\n if error then return console.error(error)\n window.map = initialize(db)\n","siFormat = d3.format('s')\ndistanceFormat = (d) -> if d == 0 then '0' else \"#{siFormat(d)}m\"\n\n\napp.scale = (options) ->\n map = options.map\n scaleg = options.scaleg\n\n renderScale = ->\n deg_150px = (map.projection.invert([150, 0])[0] - map.projection.invert([0, 0])[0])\n mapscale = d3.scale.linear()\n .domain([0, deg_150px])\n .rangeRound([0, 150])\n\n scaleg.selectAll().remove()\n axis = d3.svg.axis()\n .scale(mapscale)\n .orient('bottom')\n .ticks(2)\n .tickSize(6, 0)\n .tickFormat(distanceFormat)\n scaleg.call(axis)\n\n map.dispatch.on('zoom.scale', renderScale)\n map.dispatch.on('redraw.scale', renderScale)\n","app.symbol = {}\n\napp.symbol.textWithHalo = (g, label) ->\n g.append('text')\n .attr('class', 'halo')\n .text(label)\n g.append('text')\n .text(label)\n\n\napp.symbol.calculateLabelWidth = (g, poiLayer) ->\n g.selectAll('text')\n .data(poiLayer)\n .enter().append('text')\n .attr('class', 'halo')\n .text((d) -> d.properties.name)\n\n g.selectAll('text')\n .each (d) ->\n bbox = @getBBox()\n d.properties.labelSize = {\n w: Math.ceil(bbox.width)\n h: Math.ceil(bbox.height)\n dy: bbox.y\n }\n\n\napp.symbol.defs = (defs) ->\n marsh = defs.append('pattern')\n .attr('id', 'symbol-marsh')\n .attr('width', 15)\n .attr('height', 15)\n .attr('patternUnits', 'userSpaceOnUse')\n\n marsh.append('path')\n .attr('class', 'marsh-line')\n .attr('d', \"M0,.5 L8,.5 M6,8.5 L14,8.5\")\n\n\napp.symbol.render = (symbol) ->\n if symbol.segmentSymbol\n app.symbol.segmentSymbol(symbol, d3.select(@))\n else\n app.symbol[symbol.properties.type](d3.select(@))\n\n\napp.symbol.segmentSymbol = (symbol, group) ->\n for i in d3.range(0, symbol.properties.symbols.length)\n dx = - d3.round(13 / 2 * (symbol.properties.symbols.length - 1))\n g = group.append('g')\n .attr('transform', \"translate(#{i * 13 + dx},0)\")\n app.symbol.osmc(symbol.properties.symbols[i])(g)\n\n\napp.symbol.osmc = (src) ->\n bits = src.split(':')\n foreground = bits[2].split('_')\n sym = {\n waycolor: bits[0]\n background: bits[1]\n color: foreground[0]\n graphic: foreground[1]\n }\n\n return (selection) ->\n size = 12\n selection.attr('class', 'symbol-osmc')\n\n selection.append('rect')\n .attr('class', \"background color-#{sym.background}\")\n .attr('x', - size/2 - .5)\n .attr('y', - size/2 - .5)\n .attr('width', size + 1)\n .attr('height', size + 1)\n\n switch sym.graphic\n when 'stripe'\n selection.append('rect')\n .attr('class', \"graphic color-#{sym.color}\")\n .attr('x', - size / 6)\n .attr('y', - size / 2)\n .attr('width', size / 3)\n .attr('height', size)\n\n when 'dot'\n selection.append('circle')\n .attr('class', \"graphic color-#{sym.color}\")\n .attr('r', size * .4)\n\n when 'cross'\n selection.append('rect')\n .attr('class', \"graphic color-#{sym.color}\")\n .attr('x', - size / 6)\n .attr('y', - size / 2)\n .attr('width', size / 3)\n .attr('height', size)\n\n selection.append('rect')\n .attr('class', \"graphic color-#{sym.color}\")\n .attr('x', - size / 2)\n .attr('y', - size / 6)\n .attr('width', size)\n .attr('height', size / 3)\n\n when 'triangle'\n r = size / 2\n selection.append('path')\n .attr('class', \"graphic color-#{sym.color}\")\n .attr('d', \"M#{[0,-r]} L#{[-r,r]} L#{[r,r]} M#{[0,-r]}\")\n\n\napp.symbol.alpine_hut = (selection) ->\n selection.append('path')\n .attr('class', 'symbol-alpine_hut')\n .attr('d', \"M-2,-5 L11,1 L7,1 L7,5 L-7,5 L-7,1 L-11,1 L-2,-5\")\n\napp.symbol.alpine_hut.mask = {hw: 7, hh: 5}\n\napp.symbol.chalet = app.symbol.alpine_hut\napp.symbol.hotel = app.symbol.alpine_hut\napp.symbol.guest_house = app.symbol.alpine_hut\n\n\napp.symbol.basic_hut = (selection) ->\n selection.append('path')\n .attr('class', 'symbol-basic_hut')\n .attr('d', \"M-2,-6 L11,0 L7,0 L7,4 L-7,4 L-7,0 L-11,0 L-2,-6\")\n\napp.symbol.basic_hut.mask = {hw: 7, hh: 5}\n\n\napp.symbol.peak = (selection) ->\n selection.append('path')\n .attr('class', 'symbol-peak')\n .attr('d', \"M0,-4 L5,4 L-5,4 L0,-4\")\n\napp.symbol.peak.mask = {hw: 5, hh: 4}\n\n\napp.symbol.saddle = (selection) ->\n selection.append('path')\n .attr('class', 'symbol-saddle')\n .attr('d', \"M0,0 L6,-4 L6,4 L-6,4 L-6,-4 L0,0\")\n\napp.symbol.saddle.mask = {hw: 6, hh: 4}\n\n\napp.symbol.attraction = (selection) ->\n d = \"M-4,0 L4,0 M-2,-3.5 L2,3.5 M2,-3.5 L-2,3.5\"\n\n selection.append('path')\n .attr('class', 'symbol-attraction-halo')\n .attr('transform', 'translate(.5,.5)')\n .attr('d', d)\n\n selection.append('path')\n .attr('class', 'symbol-attraction')\n .attr('transform', 'translate(.5,.5)')\n .attr('d', d)\n\napp.symbol.attraction.mask = {hw: 4, hh: 4}\n\n\napp.symbol.locationbutton = (selection) ->\n selection.append('path')\n .attr('class', 'arrow')\n .attr('d', \"M17,-17 L0,17 L0,0 L-17,0 L17,-17\")\n\n selection.append('circle')\n .attr('class', 'track')\n .attr('r', 17)\n\n selection.selectAll('.dot')\n .data([-10, 0, 10])\n .enter().append('circle')\n .attr('class', 'dot')\n .attr('r', 3)\n .attr('cx', (d) -> d)\n .attr('cy', 6)\n","app.index = (objects) ->\n map = d3.map()\n for o in objects\n map.set(o.id, o)\n return map\n\n\napp.inside = (pos, bbox) ->\n bbox[0] <= pos[0] and pos[0] < bbox[2] and bbox[1] <= pos[1] and pos[1] < bbox[3]\n\n\napp.length = (points, save=false) ->\n sum = 0\n prev = null\n\n for point in points\n unless prev?\n prev = point\n if save then prev.push(sum)\n continue\n dx = point[0] - prev[0]\n dy = point[1] - prev[1]\n delta = Math.sqrt(dx*dx + dy*dy)\n if save then point.push(sum += delta)\n prev = point\n\n return sum\n\n\napp.along = (points, distance) ->\n prev = null\n for point in points\n unless prev?\n prev = point\n continue\n if point[3] >= distance\n f = (distance - prev[3]) / (point[3] - prev[3])\n dx = point[0] - prev[0]\n dy = point[1] - prev[1]\n target = [prev[0] + dx * f, prev[1] + dy * f]\n return {\n geometry: {\n type: 'Point'\n coordinates: target\n }\n }\n prev = point\n"]}