Skip to content

Cleaner template #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 65 additions & 74 deletions folium/templates/fol_template.html
Original file line number Diff line number Diff line change
@@ -1,87 +1,78 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>L_PREFER_CANVAS=false; L_NO_TOUCH=false; L_DISABLE_3D=false;</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/leaflet.markercluster.js"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>L_PREFER_CANVAS=false; L_NO_TOUCH=false; L_DISABLE_3D=false;</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/leaflet.markercluster.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/MarkerCluster.Default.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/MarkerCluster.css"/>
<link rel="stylesheet" href="https://rawgit.com/python-visualization/folium/master/folium/templates/leaflet.awesome.rotate.css"/>

<style>

html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<style>
#map {
position:absolute;
top:0;
bottom:0;
right:0;
left:0;
}

</style>

<style>
#{{ map_id }} {
position:relative;
{{ size }}
left:0.0%;
top:0.0%;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/MarkerCluster.Default.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/MarkerCluster.css"/>
<link rel="stylesheet" href="https://rawgit.com/python-visualization/folium/master/folium/templates/leaflet.awesome.rotate.css"/>

<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<style>
#map {
position:absolute;
top:0;
bottom:0;
right:0;
left:0;
}
</style>
<style>
#{{ map_id }} {
position:relative;
{{ size }}
left:0.0%;
top:0.0%;
}
</style>
</head>

<body>

<div class="folium-map" id="{{ map_id }}" ></div>

<div class="folium-map" id="{{ map_id }}" ></div>
</body>

<script>
var southWest = L.latLng({{ min_lat }}, {{ min_lon }});
var northEast = L.latLng({{ max_lat }}, {{ max_lon }});
var bounds = L.latLngBounds(southWest, northEast);

var southWest = L.latLng({{ min_lat }}, {{ min_lon }});
var northEast = L.latLng({{ max_lat }}, {{ max_lon }});
var bounds = L.latLngBounds(southWest, northEast);

var {{ map_id }} = L.map('{{ map_id }}', {
center:[{{ lat }}, {{ lon }}],
zoom: {{ zoom_level }},
maxBounds: bounds,
layers: [],
worldCopyJump: {{ world_copy_jump.__str__().lower() }},
crs: L.CRS.{{crs}}
});

{% for tile in tile_layers %}
var {{tile['id']}} = L.tileLayer(
'{{tile['address']}}',
{
maxZoom: {{tile['max_zoom']}},
minZoom: {{tile['min_zoom']}},
continuousWorld: {{tile['continuous_world'].__str__().lower()}},
noWrap: {{tile['no_wrap'].__str__().lower()}},
attribution: '{{tile['attr']}}',
detectRetina: {{tile['detect_retina'].__str__().lower()}},
subdomains: '{{tile['subdomains']}}'
}
).addTo({{ map_id }});
{% endfor %}
var {{ map_id }} = L.map('{{ map_id }}', {
center:[{{ lat }}, {{ lon }}],
zoom: {{ zoom_level }},
maxBounds: bounds,
layers: [],
worldCopyJump: {{ world_copy_jump.__str__().lower() }},
crs: L.CRS.{{crs}}
});

{% for tile in tile_layers %}
var {{tile['id']}} = L.tileLayer(
'{{tile['address']}}',
{
maxZoom: {{tile['max_zoom']}},
minZoom: {{tile['min_zoom']}},
continuousWorld: {{tile['continuous_world'].__str__().lower()}},
noWrap: {{tile['no_wrap'].__str__().lower()}},
attribution: '{{tile['attr']}}',
detectRetina: {{tile['detect_retina'].__str__().lower()}},
subdomains: '{{tile['subdomains']}}'
}).addTo({{ map_id }});
{% endfor %}
</script>