Skip to content

Instantly share code, notes, and snippets.

@tmcw tmcw/-
Created Feb 5, 2014

What would you like to do?
layout: example
categories: example/v1.0.0
version: v1.0.0
title: International Space Station Position from Realtime API
description: Dynamic features and map position via a JSON endpoint
- markers
<div id='map'></div>
this example requires jQuery so that it can request locations with
JSONP. If you already have jQuery on your page, you don't need the script
tag below that includes it. -->
<script src=''></script>
var map ='map', '')
.setView([0, 0], 7);
var station = L.marker([0, 0], {
icon: L.mapbox.marker.icon({
'marker-symbol': 'rocket',
'marker-color': '#001ADB'
// Start updating the position of the space station
function updatePosition() {
// This example relies on - if that site is down
// or experiencing difficulties, it may fail temporarily.
$.getJSON('', function(data) {
if (data) {
// grabbing this position from the data will be different
// for each unique way that an API can express positions.
var position = L.latLng(data.iss_position.latitude, data.iss_position.longitude);
// reload position in 10 seconds
window.setTimeout(updatePosition, 1000 * 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.