Leaflet: .on('popupopen') μ΄λ²€νŠΈκ°€ λ§ˆμ»€μ—μ„œ λ°œμƒν•˜μ§€ μ•ŠμŒ

에 λ§Œλ“  2014λ…„ 09μ›” 22일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: Leaflet/Leaflet

μ•ˆλ…•ν•˜μ‹­λ‹ˆκΉŒ,

λ¬Έλ§₯
λ‚˜λŠ” 전단지에 λŒ€ν•œ μ—¬λŸ¬ AngularJS μ§€μ‹œλ¬Έμ„ μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€. ν•˜λ‚˜λŠ” μ§€λ„μš©, ν•˜λ‚˜λŠ” λ ˆμ΄μ–΄μš©, ν•˜λ‚˜λŠ” 마컀용, ν•˜λ‚˜λŠ” νŒμ—…μš©μž…λ‹ˆλ‹€.

νŒμ—…μ— λŒ€ν•œ 각도 μ§€μ‹œλ¬Έμ€ μ—°κ²°ν•  마컀λ₯Ό μˆ˜μ‹ ν•©λ‹ˆλ‹€.

    .bindPopup(popup)
    .on('dragstart', function () {
        console.log(dragstart");
    })
    .on('dragend', function () {
        console.log("dragend!");
    })
    .on('popupopen', function (popup) {
        console.log("popup opened !", popup);
    });

μ˜ˆμƒλ˜λŠ”
λͺ¨λ“  이벀트λ₯Ό μ‹€ν–‰ν•΄μ•Ό ν•©λ‹ˆλ‹€.

κ²°κ³Ό

popupevent 이(κ°€) ν•΄κ³ λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆκΉŒ? λ‹€λ₯Έ μ‚¬λžŒλ“€μ€ ν•΄κ³ λ©λ‹ˆλ‹€.


전단지 : 0,7,2
운영체제 : μœˆλ„μš° 7
λΈŒλΌμš°μ € : ꡬ글 크둬 37 & νŒŒμ΄μ–΄ν­μŠ€ 32

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ—¬κΈ° λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. μ΄λ ‡κ²Œ ν•˜λ©΄

var coordinates = {};
var markerOptions = {};
var marker = L.marker(coordinates), markerOptions );
marker.bindPopup("my content");

bindPopup() λ©”μ†Œλ“œλŠ” String λ˜λŠ” Popup 객체λ₯Ό κ°€μ§ˆ 수 μžˆμŠ΅λ‹ˆλ‹€. 이 μ˜ˆμ—μ„œλŠ” String을 μ „λ‹¬ν•˜κ³  λ©”μ„œλ“œλŠ” μ˜¬λ°”λ₯Έ νŒμ—…μ„ μƒμ„±ν•©λ‹ˆλ‹€. μ‚¬μš©μž μ •μ˜ νŒμ—… μš”μ†Œλ₯Ό μ „λ‹¬ν•˜λŠ” 경우 이전에 νŒμ—…μ— 마컀λ₯Ό μΆ”κ°€ν•΄μ•Ό ν•©λ‹ˆλ‹€. 그렇지 μ•ŠμœΌλ©΄ νŒμ—…μ— μ†ŒμŠ€ μš”μ†Œκ°€ 없을 κ²ƒμž…λ‹ˆλ‹€.

μ΅œμ’… μ†”λ£¨μ…˜μž…λ‹ˆλ‹€.

var coordinates = {};
var markerOptions = {};
var marker = L.marker(coordinates), markerOptions );

var popupOptions = {};
// you have to append the marker on the creation of the popup
// so that the popup element will have the marker source.
var popup = L.popup(popupOptions, marker );

// and this will work !
marker
    .bindPopup(popup)
    .on('dragstart', function () {
        console.log(dragstart");
    })
    .on('dragend', function () {
        console.log("dragend!");
    })
    .on('popupopen', function (popup) {
        console.log("popup opened !", popup);
    });

λͺ¨λ“  3 λŒ“κΈ€

λͺ‡ 가지 ν…ŒμŠ€νŠΈ ν›„ νŒμ—… μ‚¬μš©μž μ •μ˜ λΌμ΄λΈŒλŸ¬λ¦¬μ—μ„œ λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

λŒ“κΈ€ avez vous fait?

2014-09-22 11:39 GMT+02:00 피에λ₯΄ λ°”λ‘± μ•Œλ¦Ό @github.com :

폐쇄 #2907 https://github.com/Leaflet/Leaflet/issues/2907.

β€”
이 이메일에 직접 λ‹΅μž₯ν•˜κ±°λ‚˜ GitHubμ—μ„œ ν™•μΈν•˜μ„Έμš”.
https://github.com/Leaflet/Leaflet/issues/2907#event -168346883.

μ—¬κΈ° λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. μ΄λ ‡κ²Œ ν•˜λ©΄

var coordinates = {};
var markerOptions = {};
var marker = L.marker(coordinates), markerOptions );
marker.bindPopup("my content");

bindPopup() λ©”μ†Œλ“œλŠ” String λ˜λŠ” Popup 객체λ₯Ό κ°€μ§ˆ 수 μžˆμŠ΅λ‹ˆλ‹€. 이 μ˜ˆμ—μ„œλŠ” String을 μ „λ‹¬ν•˜κ³  λ©”μ„œλ“œλŠ” μ˜¬λ°”λ₯Έ νŒμ—…μ„ μƒμ„±ν•©λ‹ˆλ‹€. μ‚¬μš©μž μ •μ˜ νŒμ—… μš”μ†Œλ₯Ό μ „λ‹¬ν•˜λŠ” 경우 이전에 νŒμ—…μ— 마컀λ₯Ό μΆ”κ°€ν•΄μ•Ό ν•©λ‹ˆλ‹€. 그렇지 μ•ŠμœΌλ©΄ νŒμ—…μ— μ†ŒμŠ€ μš”μ†Œκ°€ 없을 κ²ƒμž…λ‹ˆλ‹€.

μ΅œμ’… μ†”λ£¨μ…˜μž…λ‹ˆλ‹€.

var coordinates = {};
var markerOptions = {};
var marker = L.marker(coordinates), markerOptions );

var popupOptions = {};
// you have to append the marker on the creation of the popup
// so that the popup element will have the marker source.
var popup = L.popup(popupOptions, marker );

// and this will work !
marker
    .bindPopup(popup)
    .on('dragstart', function () {
        console.log(dragstart");
    })
    .on('dragend', function () {
        console.log("dragend!");
    })
    .on('popupopen', function (popup) {
        console.log("popup opened !", popup);
    });
이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰