html - How to call a leaflet Javascript Function in dropdown menu bar? -
i have following problem: target hybrid app leaflet. create dropdown menu html/css/jquery. here code:
<nav> <ul> <li id="menupoint1"><image src="../img/icon/info.png"/> <ul class="submenupoint1"> <li class="firstli"><a href='#'>interpretation</a></li> <li ><a href='#'>kennblatt</a></li> <hr> <image src="http://maps.ioer.de/cgi-bin/wms?map=s02rg_1000&&service=wms&version=1.3.0&sld_version=1.1.0&request=getlegendgraphic&format=image/jpeg&layer=s02rg_2012_a"/> </ul> </li> <li id="menupoint2"><image src="../img/icon/ebenen.png"/></li> <li id="menupoint3"><image src="../img/icon/kalender.png"/></li> <li id="menupoint4"><image src="../img/icon/lupe.png"/> <ul class="submenupoint4"> <li id="search"></li> </ul> </li> <li id="menupoint5"><image src="../img/icon/helligkeit.png"/></li> </ul> now call leaflet geosearch plug in https://github.com/smeijer/l.geosearch @ point li id="search"
i know how call function within javascript part, not within list element, outside leaflet function.
the code leaflet map is:
new l.control.geosearch({ position: 'topcenter', provider: new l.geosearch.provider.openstreetmap(), }).addto(map); which implement in dropdown menu.
much !
i found solution:
var search = document.getelementbyid('suche'); search.appendchild(new l.control.geosearch({ provider: new l.geosearch.provider.openstreetmap(), }).onadd(map));
Comments
Post a Comment