ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Map Snippets

by geraldarthur ST2/ST3

A set of custom web mapping snippets for Sublime Text 2/3

Labels snippets

Details

  • 2015.10.06.18.12.21
  • github.​com
  • github.​com
  • 2 years ago
  • 2 hours ago
  • 4 years ago

Installs

  • Total 439
  • Win 290
  • OS X 91
  • Linux 58
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5
Windows 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 2 0 1 3 1 1 0 1 1 0 0 0 1 0 0
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime Text Web Mapping Snippets

Work in progress.

Type the snippet shortcode and then press Tab to complete the snippet. Each shortcut provides a basic HTML page skeleton for the latest version of popular JavaScript mapping APIs.

The snippets are listed below in alphabetical order. The '$1' indicates the position of the caret/s. Any snippet that has a $1/$2/$3/etc. uses this technique. Pressing tab will cycle you through these positions.

Feel free to expand upon these snippets as you please.


gmaps

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map-canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=$1&sensor=$2">
    </script>
  </head>
  <body>
    <div id="map-canvas"/>
    <script type="text/javascript">
      function initialize() {
        var map = new google.maps.Map(document.getElementById("map-canvas");
      }
      google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </body>
</html>

leaflet

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>$1</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
  <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
  <style type="text/css">
    body { margin:0; padding:0; }
    #map { position:absolute; top:0; bottom:0; width:100%; }
  </style>
</head>
<body>
  <div id="map"></div>
  <script>
    var map = L.map('map');
    L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
        key: $2,
        styleId: "997",
        attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
    }).addTo(map);
    $3
  </script>
</body>
</html>

mapbox

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>$1</title>
  <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
  <script src='//api.tiles.mapbox.com/mapbox.js/v1.6.0/mapbox.js'></script>
  <link href='//api.tiles.mapbox.com/mapbox.js/v1.6.0/mapbox.css' rel='stylesheet' />
  <style>
    body { margin:0; padding:0; }
    #map { position:absolute; top:0; bottom:0; width:100%; }
  </style>
</head>
<body>
  <div id="map"></div>
  <script type="text/javascript">
    var map = L.mapbox.map('map', 'examples.map-9ijuk24y');
    $2
  </script>
</body>
</html>

ol3 (OpenLayers 3) “html <!doctype html>

.map { height: 400px; width: 100%; } adsadas