1 回答

TA貢獻(xiàn)1820條經(jīng)驗(yàn) 獲得超10個(gè)贊
map.on('click', 'unclustered-point', function (e) {
? ?var agencyemail = e.features[0].properties.email;?
? ?// the variable functions correctly within the onclick function... and then more
? ?// HERE is where you would use that variable to change something in a form, for example with jquery:
? ?$('a.mailto').prop('href','mailto:' + agencyemail);
}
如果你用一個(gè)<a class="mailto">元素創(chuàng)建你的 html 文檔,你可以看到它工作
這是假設(shè)var agencyemail = e.features[0].properties.email; 實(shí)際上會(huì)為您提供所需的信息,我無(wú)法驗(yàn)證這一點(diǎn)。
添加回答
舉報(bào)