Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% extends 'weather/base.html' %}
- {% block content %}
- <div id="wxblox" class="aeris-wrapper"></div>
- <script>
- var lat = 'sofia';
- var lon = 'bulgaria';
- function getLocation() {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(showPosition);
- } else {
- alert("Sorry, your browser does not support HTML5 geolocation.");
- }
- }
- function showPosition(position) {
- lat = position.coords.latitude;
- lon = position.coords.longitude;
- }
- getLocation();
- Aeris.wxblox.setAccess('iLjmgjGfsFSZq1wOjMRfH', 'MEvHiJUWZmrMKBz1R07HfbSGxhLgQYxJuE7AvY0X');
- var view = new Aeris.wxblox.layouts.local.Main('#wxblox', {
- obs: {
- advisories: {
- enabled: true
- },
- threats: {
- enabled: true
- }
- },
- nearby: {
- request: {
- limit: 4
- }
- },
- shortterm: {
- request: {
- limit: 3
- }
- },
- forecast: {
- type: "detailed"
- },
- maps: {
- animation: {
- enabled: true,
- autoplay: false,
- alwaysShowPast: false,
- alwaysShowFuture: false,
- from: -2,
- to: 0,
- duration: 2,
- endDelay: 1,
- intervals: 10
- },
- controls: {
- layers: [
- {
- code: "radar",
- title: "Radar"
- }, {
- code: "satellite",
- title: "Satellite"
- }, {
- code: "alerts",
- title: "Advisories"
- }, {
- code: "temperatures,clip-us-flat",
- title: "Temps"
- }
- ],
- regions: [
- {
- zoom: 7,
- title: "Local"
- }, {
- zoom: 5,
- title: "Regional"
- }
- ]
- }
- }
- });
- view.load({
- p: lat + ', ' + lon
- });
- </script>
- {% endblock content %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement