From f55de9ac7d97a92d8588e8b4be3f6f87bf5ba2d1 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 13 Nov 2016 20:57:04 -0500 Subject: [PATCH] Create source switcher in ui() loaded callback --- index.html | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 930cd9e1c..1a4395b2e 100644 --- a/index.html +++ b/index.html @@ -22,24 +22,26 @@ .imagery(iD.dataImagery) .assetPath('dist/'); - id.ui()(document.getElementById('id-container')); + id.ui()(document.getElementById('id-container'), function() { + iD.d3.select('#about-list') + .insert('li', '.user-list') + .attr('class', 'source-switch') + .call(iD.uiSourceSwitch(id) + .keys([ + { + 'urlroot': 'http://www.openstreetmap.org', + 'oauth_consumer_key': '5A043yRSEugj4DJ5TljuapfnrflWDte8jTOcWLlT', + 'oauth_secret': 'aB3jKq1TRsCOUrfOIZ6oQMEDmv2ptV76PA54NGLL' + }, + { + 'urlroot': 'http://api06.dev.openstreetmap.org', + 'oauth_consumer_key': 'zwQZFivccHkLs3a8Rq5CoS412fE5aPCXDw9DZj7R', + 'oauth_secret': 'aMnOOCwExO2XYtRVWJ1bI9QOdqh1cay2UgpbhA6p' + } + ]) + ); + }); - iD.d3.select('#about-list') - .insert('li', '.user-list') - .attr('class', 'source-switch') - .call(iD.uiSourceSwitch(id) - .keys([ - { - 'urlroot': 'http://www.openstreetmap.org', - 'oauth_consumer_key': '5A043yRSEugj4DJ5TljuapfnrflWDte8jTOcWLlT', - 'oauth_secret': 'aB3jKq1TRsCOUrfOIZ6oQMEDmv2ptV76PA54NGLL' - }, - { - 'urlroot': 'http://api06.dev.openstreetmap.org', - 'oauth_consumer_key': 'zwQZFivccHkLs3a8Rq5CoS412fE5aPCXDw9DZj7R', - 'oauth_secret': 'aMnOOCwExO2XYtRVWJ1bI9QOdqh1cay2UgpbhA6p' - } - ]));