geolocation - creating and adjusting color of L.polygon in leafletjs -


i working leaflet library v. 0.7.7 want create polygon, set markers , define polygon colors, there no way

  var polygon = new l.polygon();     <c:foreach var="marker" items="${markers}" varstatus="rowindex">     var marker${rowindex.index} = l.marker([${marker.lat},${marker.lng}],{icon: yellowicon,title: '${marker.title}'}).addto(mymap)             .bindpopup( "${marker.htmlmarkerpopupcode}").openpopup();             polygon.addlayer        (marker${rowindex.index});      </c:foreach>      polygon.setstyle({fillcolor: '#0000ff'});     polygon.setstyle({color: 'red'});     polygon.setstyle({fillopacity: 0.5});     mymap.addlayer( polygon ); 

unfortunately l.polygon single layer, not layer group. not supposed contain other layers / markers.

the polygon.addlayer() line should throw error.

if understanding correct, draw polygon vertices markers? in case, should read markers coordinates , store them array, build polygon using array of coordinates.

then styling / colors should work.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -