Skip to content

Commit 162c869

Browse files
pan map on when changing options
1 parent c054ace commit 162c869

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

embed-preview.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@
7272
params += "&expandgraph=" + ($("#opt_graph_open").prop("checked") ? 1 : 0);
7373
params += "&filter=" + encodeURIComponent($("#opt_filter").val());
7474

75-
console.log(params);
76-
7775
code = code.replace("&preview", params);
7876

7977
$("textarea").html(code);
78+
79+
// center followed vehicle
80+
var p = $("iframe").contents()[0].defaultView;
81+
if('panTo' in p) setTimeout( function() { p.panTo(p.follow_vehicle); }, 300);
8082
}
8183

8284

0 commit comments

Comments
 (0)