UNPKG

core-resource-app-test

Version:

App that contains assets and scripts for the core apps

58 lines (50 loc) 2.43 kB
<!DOCTYPE html> <html> <head> <title>Using geocoding plugin with Tangram.</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> <script src="assets/modernizr.js"></script> <!-- Load Leaflet from CDN --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.js"></script> <!-- Load leaflet-hash --> <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-hash/0.2.1/leaflet-hash.min.js"></script> <!-- Load geocoding plugin after Leaflet --> <link rel="stylesheet" href="../dist/leaflet-geocoder-mapzen.css"> <script src="../dist/leaflet-geocoder-mapzen.js"></script> <!-- Load Tangram --> <script src="https://mapzen.com/tangram/0.4/tangram.min.js"></script> <link rel="stylesheet" href="assets/examples.css"> </head> <body> <div id="message" class="no-webgl-message">Your browser cannot display the map on this page. <a href="index.html">Try this one instead.</a></div> <div id="map"></div> <script> // Create a basic Leaflet map (with URL hash enabled) var map = L.map('map').setView([43.0809, -89.3747], 13); var hash = new L.Hash(map); // Add geocoding plugin var geocoder = L.control.geocoder('search-MKZrG6M').addTo(map); // Add Tangram scene layer // (Note: Tangram can also be initialized before the geocoder, if you choose.) var layer = Tangram.leafletLayer({ scene: 'https://cdn.rawgit.com/tangrams/cinnabar-style-more-labels/561b18408038edfd664f5fc772eb9037b7966d21/cinnabar-style-more-labels.yaml', attribution: 'Rendering by <a href="https://mapzen.com/tangram">Tangram</a> | &copy; OSM contributors | <a href="https://mapzen.com/">Mapzen</a>' }).addTo(map); </script> <script type="text/javascript"> // Compatibility checks (function () { var messageEl = document.getElementById('message'); var mapEl = document.getElementById('map'); var height; // This message box is displayed if Modernizr cannot detect WebGL support. if (messageEl.style.display !== 'none') { height = messageEl.getBoundingClientRect().bottom; // No .height in IE8, but top is assumed to be 0 mapEl.style.top = height.toString() + 'px'; } })(); </script> </body> </html>