5 <%= stylesheet_link_tag 'iD' %>
6 <!--[if !IE || gte IE 9]><!-->
7 <%= javascript_include_tag 'iD' %>
11 <div id='id-container'></div>
13 if (typeof iD == 'undefined') {
14 document.getElementById('id-container').innerHTML = 'This editor is supported ' +
15 'in Firefox, Chrome, Safari, Opera, and Internet Explorer 9 and above. ' +
16 'Please upgrade your browser or use Potlatch 2 to edit the map.';
17 document.getElementById('id-container').className = 'unsupported';
19 <% locale = select_locale(ID::LOCALES).to_s %>
23 .assetPath("/assets/iD/") <%# Can't use asset_path('iD/') in production. %>
24 .locale("<%= locale %>", "<%= asset_path("iD/locales/#{locale}.json") %>")
26 <% token = @user.access_token(ID_KEY) %>
27 url: "<%= request.protocol + request.host_with_port %>",
28 oauth_consumer_key: "<%= token.client_application.key %>",
29 oauth_secret: "<%= token.client_application.secret %>",
30 oauth_token: "<%= token.token %>",
31 oauth_token_secret: "<%= token.secret %>"
34 id.map().on('move.embed', function() {
35 var extent = id.map().extent(),
36 zoom = ~~id.map().zoom(),
37 center = id.map().center();
51 parent.$("body").on("click", "a.set_position", function (e) {
53 var data = parent.$(this).data();
55 // 0ms timeout to avoid iframe JS context weirdness.
56 // http://bl.ocks.org/jfirebaugh/5439412
57 setTimeout(function() {
60 Math.max(data.zoom || 15, 13));
64 var maximized = false;
65 id.on('toggleFullscreen.embed', function() {
71 maximized = !maximized;
74 d3.select('#id-container')