Browse Source

Custom Map Stage 1

master
Evgeny Gagua 3 years ago
parent
commit
b65be194a4
  1. 45
      lib/javascript/clipchamp/player.js
  2. 34
      lib/javascript/jsapi_dynamic/mojo_settings.js

45
lib/javascript/clipchamp/player.js

@ -15,7 +15,16 @@
(function($) {
var DEFAULT_FPS = 15,
DEFAULT_AUTOLOOP = true,
JPEG_MAGIG_NUMBER = [0xff, 0xd8, 0xff], CONTINUE_PLAY = true, imageElement = null, nextFrameIndex = 0, jpegUrl, jpegFiles = null, autoloop = false, fps =1, ran=null;
JPEG_MAGIG_NUMBER = [0xff, 0xd8, 0xff],
CONTINUE_PLAY = true,
imageElement = null,
nextFrameIndex = 0,
jpegUrl,
jpegFiles = null,
autoloop = false,
fps =1,
ran=null,
timerBOBA = null;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout;
function showNextFrame() {
@ -30,12 +39,22 @@
if (imageElement) {
if (autoloop || nextFrameIndex < jpegFiles.length) {
nextFrameIndex = (nextFrameIndex === jpegFiles.length) ? 0 : nextFrameIndex;
ran.value = nextFrameIndex;
if( ( nextFrameIndex % fps ) == 0 ) ran.value = nextFrameIndex;
if( CONTINUE_PLAY )
setTimeout(function() {
if( CONTINUE_PLAY ) {
if( timerBOBA == null ){
timerBOBA = setInterval(
//setTimeout(
function() {
requestAnimationFrame(showNextFrame);
}, 1000/fps);
};
} else {
if( timerBOBA!= null ){
clearInterval( timerBOBA );
timerBOBA = null;
};
};
}
}
};
@ -119,11 +138,23 @@
ctlDIV.appendChild(btn);
dWE.appendChild(ctlDIV);
if (jpegFiles.length > 0) {
if( CONTINUE_PLAY ) setTimeout(function() {
if( CONTINUE_PLAY ) {
if( timerBOBA == null ){
timerBOBA = setInterval(
//setTimeout(
function() {
requestAnimationFrame(showNextFrame);
}, 1000/fps);
};
} else {
if( timerBOBA!= null ){
clearInterval( timerBOBA );
timerBOBA = null;
};
};
//if( CONTINUE_PLAY ) setTimeout(function() {
// requestAnimationFrame(showNextFrame);
//}, 1000/fps);
} else {
alert('Error Loading Video');
};

34
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -2273,7 +2273,7 @@ function showSettingsApplication(){
//items:{
xtype: 'panel',
id: 'sys_location_map',
height: PanelH-150,
height: PanelH-170,
html: '&nbsp;',
listeners:{
afterrender: function( t, state ){
@ -2294,21 +2294,30 @@ function showSettingsApplication(){
textAlign: 'center'
},
items:[{
border: false,
html: '<?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> <?=$Labels->GetLabel('_LAT_SHORT_LBL_');?>:'
},{
xtype: 'textfield',
xtype: 'numberfield',
id: 'siteLat',
decimalPrecision: 8,
width: 100,
value: SiteLat
},{
border: false,
html: '<?=$Labels->GetLabel('_LON_SHORT_LBL_');?>:'
},{
xtype: 'textfield',
xtype: 'numberfield',
width: 100,
decimalPrecision: 8,
id: 'siteLon',
value: SiteLon
},{
border: false,
html: '<?=$Labels->GetLabel('_ALT_SHORT_LBL_');?>:'
},{
xtype: 'textfield',
xtype: 'numberfield',
decimalPrecision: 2,
width: 100,
id: 'siteAlt',
value: SiteAlt
},{
@ -2316,8 +2325,9 @@ function showSettingsApplication(){
text: '<?=$Labels->GetLabel('_UPDATE_LBL_');?>',
handler: updateSiteAnchor
},{
border: false,
html: '<?=$Labels->GetLabel('_MAP_TYP_LBL_');?>:'
},{
},/*{
xtype: 'radio',
name: 'map_type',
boxLabel: '<?=$Labels->GetLabel('_MAP_REG_LBL_');?>',
@ -2329,21 +2339,21 @@ function showSettingsApplication(){
boxLabel: '<?=$Labels->GetLabel('_MAP_CUST_LBL_');?>',
colspan: 2,
value: 1
},{
},*/{
xtype: 'combo',
disabled: true,
disabled: false,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
colspan: 2,
colspan: 5,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: ['myId', 'displayText' ],
data: [[1, 'item1'], [2, 'item2']]
fields: ['map_id', 'map_text' ],
data: [[1, 'OpenStreetMap'], [2, 'OpenTopoMap'], [3, 'EsriSat'], [4, 'EsriStreet'], [5, 'EsriTopo']]
}),
valueField: 'myId',
displayField: 'displayText'
valueField: 'map_id',
displayField: 'map_text'
},{
xtype: 'button',

Loading…
Cancel
Save