Created
April 8, 2014 22:36
-
-
Save tmcw/10203442 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var map = L.mapbox.map('map', 'XXX', {zoomControl: false}) | |
| .setView([-20.1908, -67.5893], 3); | |
| var geoJson = { | |
| type: 'FeatureCollection', | |
| features: [ | |
| { | |
| type: 'Feature', | |
| geometry: { | |
| type: 'Point', | |
| coordinates: [-67.5893, -20.1908] | |
| }, | |
| properties: { | |
| title: 'Salar de Uyuni', | |
| 'marker-size': 'small', | |
| 'marker-color': '#fff', | |
| url: 'http://localhost' | |
| } | |
| }, | |
| { | |
| type: 'Feature', | |
| geometry: { | |
| type: 'Point', | |
| coordinates: [170.2, -43.4764] | |
| }, | |
| properties: { | |
| title: 'Franz Josef Glacier', | |
| 'marker-size': 'small', | |
| 'marker-color': '#fff', | |
| url: 'http://localhost' | |
| } | |
| } | |
| ] | |
| }; | |
| var myLayer = L.mapbox.featureLayer() | |
| .setGeoJSON(geoJson) | |
| .addTo(map); | |
| myLayer.on('click', function(e) { | |
| e.layer.unbindPopup(); | |
| window.open(e.layer.feature.properties.url); | |
| }); | |
| map.fitBounds(myLayer.getBounds()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment