Team Ai
Apppublic

Sowmya15/Identifying_Commercial_Centers_Using_Machine_Learning

sourceHugging Facebigscience-openrail-mupdated 4y agoView on Hugging Face
0likes
maplegend.py95 linesDownload Raw Back to root
1from branca.element import Template, MacroElement2def temp():3  #code copied from: https://nbviewer.org/gist/talbertc-usgs/18f8901fc98f109f2b71156cf3ac81cd4  template = """5  {% macro html(this, kwargs) %}6 7<!doctype html>8<html lang="en">9<head>10  <meta charset="utf-8">11  <meta name="viewport" content="width=device-width, initial-scale=1">12  <title>jQuery UI Draggable - Default functionality</title>13  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">14 15  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>16  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>17  18  <script>19  $( function() {20    $( "#maplegend" ).draggable({21                    start: function (event, ui) {22                        $(this).css({23                            right: "auto",24                            top: "auto",25                            bottom: "auto"26                        });27                    }28                });29});30 31  </script>32</head>33<body>34 35 36<div id='maplegend' class='maplegend' 37    style='position: absolute; z-index:9999; border:2px solid grey; background-color:rgba(255, 255, 255, 0.8);38     border-radius:6px; padding: 10px; font-size:14px; right: 20px; bottom: 20px;'>39     40 41<div class='legend-scale'>42  <ul class='legend-labels'>43    <li><span style='background:red;opacity:0.7;'></span>Most Significant Cluster</li>44    <li><span style='background:yellow;opacity:0.7;'></span>Least Significant Cluster</li>45    46 47  </ul>48</div>49</div>50 51</body>52</html>53 54<style type='text/css'>55  56  .maplegend .legend-scale ul {57    margin: 0;58    margin-bottom: 5px;59    padding: 0;60    float: left;61    list-style: none;62    }63  .maplegend .legend-scale ul li {64    font-size: 80%;65    list-style: none;66    margin-left: 0;67    line-height: 18px;68    margin-bottom: 2px;69    }70  .maplegend ul.legend-labels li span {71    display: block;72    float: left;73    height: 16px;74    width: 30px;75    margin-right: 5px;76    margin-left: 0;77    border: 1px solid #999;78    }79  .maplegend .legend-source {80    font-size: 80%;81    color: #777;82    clear: both;83    }84  .maplegend a {85    color: #777;86    }87</style>88{% endmacro %}"""89 90  macro = MacroElement()91  macro._template = Template(template)92 93  #map_osm.get_root().add_child(macro)94 95  return macro