Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h1>Geohash Example</h1>

<p>Your location <br><span id="coords"></span></p>
<p>Geohash grid <br><span id="geohash"></span></p>

<h2>This particular geohash method works this way:</h2>
<p>The precision increases as you increase the resolution.</p>

<p>At resolution 0, each grid size is approx 111km x 111km (circumference of the earth 40,075km/360deg).
Resolution 1 gives 11km x 11km grids.
<p>The example below is for SoMa, San Francisco at lat: 37.7834462, lon: -122.39952480000001 (Geohash grid is <strong>37-123</strong>).</p>

  <img src="">



                body {
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif; 
  margin: 1em;
  background: #fff;
  color: #293950;
  font-size: 1.2em;
h1, h2 {
  text-rendering: optimizeLegibility;
  font-weight: normal;
img {
  width: 1517px;
#geohash {
  color: #ce1126;
  font-weight: 600;


                var lat, lon;

navigator.geolocation.getCurrentPosition(function(position) {
  lat = position.coords.latitude;
  lon = position.coords.longitude;
  document.getElementById('coords').textContent = 'lat: '+lat+', lon: '+lon;
  document.getElementById('geohash').textContent = geohash(lat, 0) + '' + geohash(lon, 0);

function geohash(coord, resolution) {
    var rez = Math.pow(10, resolution || 0);
    return Math.floor(coord * rez) / rez;