From 45761008bf433a5b8bd78da42191ef390f836f5e Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Thu, 21 Jun 2018 11:13:38 -0400 Subject: [PATCH] cleaned: extraneous details in notes --- modules/services/notes.js | 11 +++-------- modules/svg/notes.js | 3 --- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/modules/services/notes.js b/modules/services/notes.js index 1cec4c21e..606f0bbfb 100644 --- a/modules/services/notes.js +++ b/modules/services/notes.js @@ -21,7 +21,6 @@ import { geoExtent } from '../geo'; import { osmNote, - osmEntity, } from '../osm'; import { @@ -31,7 +30,6 @@ import { var urlroot = 'https://api.openstreetmap.org', _notesCache, - __notesSelectedNote, dispatch = d3_dispatch('loadedNotes', 'loading'), tileZoom = 14; @@ -47,7 +45,6 @@ function authLoading() { dispatch.call('authLoading'); } - function authDone() { dispatch.call('authDone'); } @@ -202,11 +199,9 @@ function parse(xml, callback, options) { var parser = parsers[child.nodeName]; if (parser) { // TODO: change how a note uid is parsed. Nodes also share 'n' + id - // var uid = osmEntity.id.fromOSM(child.nodeName, child.childNodes[1].innerHTML); var childNodes = child.childNodes; var id; var i; - for (i = 0; i < childNodes.length; i++) { if (childNodes[i].nodeName === 'id') { id = childNodes[i].nodeName; } } @@ -239,8 +234,6 @@ export default { } _notesCache = { notes: { inflight: {}, loaded: {}, rtree: rbush() } }; - - __notesSelectedNote = null; }, authenticated: function() { @@ -251,7 +244,9 @@ export default { options = _extend({ cache: true }, options); function done(err, xml) { - if (err) { console.log ('error: ', err); } + if (err) { + callback(err, xml); + } parse( xml, function(entities) { diff --git a/modules/svg/notes.js b/modules/svg/notes.js index f1452ece5..567f1222f 100644 --- a/modules/svg/notes.js +++ b/modules/svg/notes.js @@ -1,4 +1,3 @@ -import _some from 'lodash-es/some'; import _throttle from 'lodash-es/throttle'; import { select as d3_select } from 'd3-selection'; import { svgPointTransform } from './index'; @@ -7,8 +6,6 @@ import { services } from '../services'; export function svgNotes(projection, context, dispatch) { var throttledRedraw = _throttle(function () { dispatch.call('change'); }, 1000); var minZoom = 12; - var minMarkerZoom = 16; - var minViewfieldZoom = 18; var layer = d3_select(null); var _notes;