Newer
Older
leaflet_plugins / make_CMSD / tamesi.js
@natto natto on 17 Sep 2018 2 KB some date
//var lt=[39.00047,140.05172];

/*function ColorBox(ac,panpan,tenten){
var s_width=window.innerWidth;
var s_height=window.innerHeight;

//console.log(coments.length);
var getel_c=document.getElementsByClassName("leaflet-marker-icon");

for(i=0; i<getel_c.length; i++){
    if(ac[i].match(/^https/)){
	getel_c[i].classList.add("movie");
	getel_c[i].setAttribute("href",ac[i]);
	getel_c[i].setAttribute("id",i); 
    };
    // getel_c is array. Because I use 'for'
};

//var menes=document.getElementsByClassName("mene");
//console.log(menes.length);
//マーカーの数を数える
//console.log(menes[1]);

//var unko=1;
mymap.on('popupopen', function(o) {
    $(function(){
	$('.movie').colorbox({
	    onOpen:function(){mymap.closePopup();},
	    onLoad:function(){
		mymap.setZoom(18);
	    },
	    iframe: true,
	    width:340,
	    height: 180,
	    rel:'movie', //同じクラス名のものをスライド表示
	    //width:s_width-100,
	    onClosed:function(){		
		var pan=$.colorbox.element().context.attributes.id.nodeValue;
		//console.log(pan);
		var lat=panpan[pan][1],lng=panpan[pan][0];
		var pan_to=[lat,lng];
		mymap.flyTo(pan_to);
		tenten[pan].openPopup();
	    }
	    
	});
    });
});
};*/
/*
var s_width=window.innerWidth;
var s_height=window.innerHeight;

//console.log(coments.length);
var getel_c=document.getElementsByClassName("leaflet-marker-icon");

//alert("unko");

for(i=0; i<getel_c.length; i++){
    if(coments[i].match(/^https/)){
	getel_c[i].classList.add("movie");
	getel_c[i].setAttribute("href",coments[i]);
	getel_c[i].setAttribute("id",i); 
    };
    // getel_c is array. Because I use 'for'
};
*/
//var menes=document.getElementsByClassName("mene");
//console.log(menes.length);
//マーカーの数を数える
//console.log(menes[1]);

//var unko=1;
mymap.on('popupopen', function(o) {
    $(function(){	
	$('.movie').colorbox({
	    onOpen:function(){mymap.closePopup();},
	    onLoad:function(){
		mymap.setZoom(18);
	    },
	    iframe: true,
	    width:680,
	    height: 540,
	    rel:'movie', //同じクラス名のものをスライド表示
	    //width:s_width-100,
	    onClosed:function(){		
		var pan=$.colorbox.element().context.attributes.id.nodeValue;
		//console.log(pan);
		var lat=usepan[pan][1],lng=usepan[pan][0];
		var pan_to=[lat,lng];
		mymap.flyTo(pan_to);
		ten[pan].openPopup();
	    }
	    
	});
    });
});