Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <head>
- <title>Une carte editable par les utilisateurs/trices</title>
- <meta charset="UTF-8">
- <script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>
- <link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />
- <!-- Les bibliothèques de Firebase -->
- <script src="https://www.gstatic.com/firebasejs/7.8.1/firebase-app.js"></script>
- <script src="https://www.gstatic.com/firebasejs/7.8.1/firebase-auth.js"></script>
- <script src="https://www.gstatic.com/firebasejs/7.8.1/firebase-database.js"></script>
- <style>
- html, body {height: 100%; margin: 0;}
- #Carte { width: 100%; height: 100%; }
- </style>
- </head>
- </head>
- <body>
- <div id='Carte'></div>
- <script>
- // créer la carte, remplacez VOTRE_TOKEN pour la clef que vous trouverez là : https://account.mapbox.com
- //var fondDeCarte = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/outdoors-v11/tiles/{z}/{x}/{y}?access_token=VOTRE_TOKEN');
- // décochez la ligne suivante si vous n'avez pas de compte MapBox
- var fondDeCarte = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
- var maCarte = L.map('Carte', {
- center: [45.52,-73.63],
- zoom: 13,
- layers: fondDeCarte,
- zoomControl: false
- });
- maCarte.setView([0,0], 2);
- // Ajoût de la configuration de la connexion à la base de donnée en ligne Firebase.
- var firebaseConfig = {
- apiKey: "AIzaSyA36m1RLJb2eppWVTVhaXINYay9-Tp_7Ek",
- authDomain: "atelier3-1e7e2.firebaseapp.com",
- databaseURL: "https://atelier3-1e7e2.firebaseio.com",
- projectId: "atelier3-1e7e2",
- storageBucket: "atelier3-1e7e2.appspot.com",
- messagingSenderId: "565440140120",
- appId: "1:565440140120:web:a734a2aa00f9909ed10b2d"
- };
- // initialisez la base de données Firebase
- firebase.initializeApp(firebaseConfig);
- var database = firebase.database();
- ref = database.ref('Atelier4');
- // Première fonction importante : push()
- ref.push({a: 'a', b: 1254});
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement