- #PANO2VR JAVASCRIPT HOW TO#
- #PANO2VR JAVASCRIPT UPDATE#
- #PANO2VR JAVASCRIPT CODE#
- #PANO2VR JAVASCRIPT DOWNLOAD#
#PANO2VR JAVASCRIPT UPDATE#
Update 12 July 2016: MapQuest discontinued the tile set I was using, so I switched to OpenStreetMap’s tiles.
#PANO2VR JAVASCRIPT CODE#
I recommend using it instead of copying the code on this page. Note that the version on GitHub might look different that what is outlined here since it has been updated to use more recent versions of the libraries. Project Files: The files used in this example are available on GitHub.
#PANO2VR JAVASCRIPT HOW TO#
I hope this is useful to someone out there in internet-land!Īs always, if you have suggestions on how to improve my code or make things easier, please comment below or feel free to contact me. If you end up with too many markers on your map, consider using Leaflet.markercluster to cluster them! Here’s our final result – an interactive map indicating the countries I’ve either lived in or travelled through for a month or more. This array of strings is substituted into the (line 24). It is important that you add the right info here for proper attribution of the tile set.įinally we have a list of subdomains. Next is the attribution – this is what shows up in the bottom-right corner of the map. In our example, the first argument is the URL template so Leaflet knows how to fetch the tiles from the servers properly. There are several different servers you can use – or you can host your own.Īgain, Leaflet has many options to use when creating a tileLayer. This code adds a layer to the map telling it what set of tiles to display and where to get them. The next interesting part of this HTML file is this div:
#PANO2VR JAVASCRIPT DOWNLOAD#
I have updated the download to fix this.) You will need to add http: to the URI for this to work.
It’s the web server which adds the correct protocol to scheme-less URIs, so if you just open the file on its own, browsers will not add it properly. ( Update: I was using MAMP to write and test this. Note that leaving the protocol off the Google URL is not an error – this is a protocol relative URL (a.k.a. This example uses to get the Leaflet CSS and library and to get the jQuery library.