FAQ Database Discussion Community


Python-geoJSON producing invalid JSON output

python,json,geojson
I am using python-geojson 1.0.9 and for some reason the output json it produces is invalid. I've tried to use it on my google maps API, doesn't work. I've checked it through geojson.io which similarly that it is not valid. Am I using the library wrong? Or is this a...

add geojson to google map without Feature wrapper

google-maps,geojson
Google Maps has the function addGeoJson to.. well... add geo JSON ;) But it seems that it only accepts geoJSON with a wrapping Feature. This polygon is directly from http://geojsonlint.com/ { "type": "Polygon", "coordinates": [ [ [ -84.32281494140625, 34.9895035675793 ], [ -84.29122924804688, 35.21981940793435 ], [ -84.24041748046875, 35.25459097465022 ], [ -84.22531127929688,...

R rMaps geoJson function not plotting

r,leaflet,geojson
I have a JSON route coming from ESRI service. I try to plot the route using geoJson using rMaps. The only output I get is the map but not the plot from the polygon. This is the code: require(rMaps) json =...

Invalid Geojson Object Angularjs &Leafletjs

angularjs,leaflet,geojson,angularjs-filter
In my project i try to synchronize filters with geojson displayed in table and on map. To achieve this i used angular and previously angular-leaflet-directive, but performance was to slow for my purposes so i decide to make my own directive for leaflet.js. In my case i can pass data...

UI tool to create geojson/topojson shapes?

javascript,maps,geojson,topojson
I want to create interactive historical maps (e.g. world borders in 1914). Obviously I will need shapefiles in geojson/topojson format for borders which do not exist anymore. Even if some of these shapes exist (I have not found any), I will need to create some on my own. Does anybody...

Return MongoDB results grouped by geometry

mongodb,mapreduce,aggregation-framework,geojson
Is it possible to query a collection in MongoDB and return the results grouped by geometric boundaries? For instance, I have one collection of addresses, each of which has a lat/long defined as a GeoJSON Point. I also have a collection of city council wards, each of which has a...

GeoJSON Not Working with Highmaps

json,highcharts,gis,geojson,highmaps
I am trying to use a custom GeoJSON file (Massachusetts counties) to display random data values using HighMaps. Here is the jfiddle of what I have done so far, but is not working... $(function () { // Prepare random data var data = [ { "COUNTY": "SUFFOLK", "value": 25 },...

Angularjs, cannot pass data to geojsonLayer Leaflet

angularjs,leaflet,geojson
So i try to create directive for leaflet.js, when i use factory inside directive, everything works just fine (function() { 'use strict'; angular .module('directoryAppMap') .directive('leafletDirective', function (Directory) { return { restrict: 'EA', template:'<div></div>', link: function (scope,element, attrs) { var map = L.map(attrs.id, { center: [40, -86], zoom: 2 }); //create...

Leaflet-draw : Create editable layers

angularjs,draw,leaflet,geojson,angular-leaflet-directive
My objective is to have a map to which I can add markers/polygons/... These elements will be saved into an Object for saving. The drawn elements can later be edited/deleted or added to. I have successfully managed to create/edit/delete them, but when I init my map with the saved objects...

How to load *part* of a multifeature geojson file in R?

r,loading,geojson
I have a geojson that is a FeatureCollection containing 2 geographic data types: a LineString and a waypoint - see the raw file here - this is how it looks on GitHub: I want to load only only the LineString, so this is what I do: library(RCurl) obj <- getURL("https://raw.githubusercontent.com/Robinlovelace/stplanr/master/inst/extdata/route_data.geojson")...

How to display custom markers in Map

leaflet,geojson
Hi I need to display custom markers in map but its unable to display on my map,please help me how to display custom markers. This is my json Object: { "features": [ { "geometry": { "coordinates": [ [-89.39982622861862, 43.06710857435938 ], [-89.39982622861862, 43.06710857435938 ] ], "type": "Point" }, "id": "ci7gsmklj004ahym0qpgca8j7", "properties":...

mongoldb insert does the property order matters?

mongodb,insert,geojson,2dsphere
I have a collection with the following indices. [ { "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "bs.locations" }, { "v" : 1, "key" : { "location" : "2dsphere" }, "name" : "location_2dsphere", "ns" : "bs.locations", "2dsphereIndexVersion" : 2 } ] I...

Plotting POINTS using GeoJSON

google-maps,google-maps-api-3,geojson,points
I am trying to plot points on a map using GeoJSON. I read the documention which states: You can load and display a GeoJSON file by calling the loadGeoJSON() method of the data object (https://developers.google.com/maps/documentation/javascript/datalayer ) However, the sample code on the same page shows: map.data.loadGeoJson( ...) So I use...

MongoDB, How to query subdocuments close to specific location?

node.js,mongodb,geojson
I have MongoDb database with collection users containing documents structured as below: { firstName: "firstname", "phone": "123456", "places":[ { "name" : "somename", "address" : "Woollahra, New South Wales, Australia", "loc" : { "type" : "Point", "coordinates" : [ 151.23721839999996, -33.8884085 ] }, "url" : "ttttt2", "registeredOn" : ISODate("2015-06-17T20:14:10.986Z"), "id" :...

How to access way coordinates from a large (.json-based) list structure

python,json,geojson
For each individual way, I am trying to build a list of coordinates from all the "nodes" associated with that particular "way". I thought, since everything was in this large list (aka "elements":) I could just use a 'for' loop...but it turns out...I cannot access the "type" : "node" (i.e....

Delete decimals of a GeoJson elevation values

javascript,regex,geojson
I have a GeoJson file that looks like this: { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "name": "first" }, "geometry": { "type": "LineString", "coordinates": [ [ 22.59323, 44.71464, 233.6 ], [ 22.59274, 44.71425, 231.8 ], [ 22.59264, 44.71405, 230.7 ],......... Every third value in coordinates represents the...

In Python, trying to convert geocoded tsv file into geojson format

python,json,geocoding,geojson,tsv
trying to convert a geocoded TSV file into JSON format but i'm having trouble with it. Here's the code: import geojson import csv def create_map(datafile): geo_map = {"type":"FeatureCollection"} item_list = [] datablock = list(csv.reader(datafile)) for i, line in enumerate(datablock): data = {} data['type'] = 'Feature' data['id'] = i data['properties']={'title': line['Movie...

Generating GeoJson with javascript

javascript,php,ajax,json,geojson
I'm getting a lat/lon array with ajax $.ajax({ type: "POST", url: '../m/m_share.php', data: 'zone=' + zone, dataType: 'json', success: function(tab) { var i = 0; var size = tab.length; for (i = 0; i < size; i++) { var lat = tab[i]['lat']; var lon = tab[i]['lon']; } } The "tab"...

Export GPX file from Leaflet

export,leaflet,geojson,gpx
What I want to do is let the users create a GPX file by selecting some GeoJson features in Leaflet. The way in which I'm doing it is by creating a new GeoJson layer to store the selected features, then converting this to gpx with a plugin called togpx (https://github.com/tyrasd/togpx)....

Invalid GeoJson (Data was not JSON serializable)

python,json,geojson
I am fairly new to the geojson spec...and formatting is causing havok. All I am trying to do is build a new "features" list (for Points only) which I am adding new 'properties' for. Then I write it into (test.json). Right now I am returning which has intermittent cases of...

Google Maps Api, GeoJson and InfoWindow

javascript,google-maps,maps,geojson
Can someone tell me why the InfoWindow doesn't appear at first click? After the first click it always works fine... I'm just loading data from a geojson file and try to adding a click event. There are some problems anchoring an infowindow to a MVCObject. var anchor = new google.maps.MVCObject();...

Clear google map from previously addGeoJson(scope.data) after watch

javascript,angularjs,google-maps,geojson
I want to synchronize google-maps with angular.js, so I created custom directive for google-maps. CODE var map; map = new google.maps.Map(document.getElementById('map'), mapOptions); scope.$watch('geojson', function(newVal, oldVal) { if (newVal !== oldVal) { map.data.setMap(null); map = new google.maps.Map(document.getElementById('map'), mapOptions); map.data.addGeoJson(scope.geojson); } }, true); My solution works but it is not what i...

Adding range sliders on Google's Data Layer Map to filter data

javascript,google-maps-api-3,geojson
Is it possible to create input functions like a slider, radio or checkbox to allow users to filter geojson data loaded into Google's Data Layer while using map.data.loadgeojson()? My understanding is that the load or addGeoJson functions on the data layer creates one single layer. How does one build an...

Leaflet Realtime GeoJSON dynamic marker color change

javascript,real-time,leaflet,geojson
I have a map built with Leaflet which displays markers from a GeoJSON using Leaflet-Realtime plugin and Leaflet-awesome-numbered-marker plugin. However I noticed that the markers color doesn't change dynamically, but it changes if I reload the page. Here's the code so far: var map = L.map('map', {center: [46.7634, 23.5996], zoom:...

How can I nest GeoJSON / TopoJSON geometries OR nest the generated paths with D3?

javascript,svg,d3.js,geojson,topojson
Problem: I'm attempting to create an interactive map of the US in which state, county and national boundaries are displayed. Counties are shaded based on data, and hovering over a state should highlight all counties in the state, and the state should be clickable. I want to achieve this by...

Failure when searching for all polygons near a point using mongoose/mongodb

node.js,mongodb,mongoose,geospatial,geojson
I am trying to search for any GeoJSON polygon that is with x number of kilometers from a point ordered by distance from the point. It's important that it is a GeoJSON polygon and not a GeoJSON point. I have the following but I get an error: 'Unable to execute...

Django SerializerDoesNotExist 'geojson'?

django,serialization,geojson,gdal
I'm trying to serialize data in the geojson format however whenever I use json = serialize("geojson", coordinate.objects.all()) response = HttpResponse(json) return response django gives me SerializerDoesNotExist at /getmarkers/ 'geojson' this works fine json = serialize("json", coordinate.objects.all()) surely anyone else who has tried using the geojson serializer has ran into the...

How do I properly nest serializers in Django REST Framework?

python,django,serialization,django-rest-framework,geojson
I need to start saying that none of the solutions provided in similar question seem to work for me. I've got two models class Building(models.Model): (...) address = models.ForeignKey('common.Address', null=True) class Address (models.Model): (...) latlng = models.PointField(null=True) I am using Django REST Framework (with addidtional GIS extension) serializers to serialize...

Tilestache - Mismatch between the coordinates present in the PostgreSQL/PostGIS and those returned by PostGeoJSON provider

postgresql,postgis,geojson,tilestache
This is the relevant bit my Tilestache config, "points-of-interest": { "provider": { "class": "TileStache.Goodies.Providers.PostGeoJSON.Provider", "kwargs": { "dsn": "dbname=database user=username host=localhost", "query": "SELECT loc_id AS __id__, loc_name, geo2 AS __geometry__ FROM location", "id_column": "__id__", "geometry_column": "__geometry__" } } }, When I access - http://127.0.0.1:8080/points-of-interest/0/0/0.json I get the Response - { "type":...

Only return selected geojson elements in leaflet

leaflet,geojson,overpass-api
I have this code that get all OSM alley elements in a map and that has a button to print all elements retrieved with overpass api. Instead retrieving all elements, I would like to me able to : select multiple elements on my map by clicking on those I want...

leafletjs: polyline list into geojson

javascript,json,google-maps,geojson
i have list of polylines. i want to make it more organized. how can i make my polyline list into the GeoJSON? var point1 = new coordsToLatLngArray(0, 100); var point2 = new coordsToLatLngArray(200, 150); var point3 = new coordsToLatLngArray(400, 70); var point4 = new coordsToLatLngArray(10, 70); var point5 = new...

Leaflet fixed pop-up position

javascript,html,google-maps,leaflet,geojson
I have create my map with Leaflet exactly how I want it (with my markers and externals links). I would like to have the popup always fixes in the top right hand corner (for an example). Is there any way to fix the popup's location ? This is how it...

How can I update GeoJSON on my mapbox map after it has been created?

javascript,jquery,mapbox,geojson
I have this html: <div id="clickthis"><p>addGeoJSON</p></div> <div id='raw'></div> <div id='map'></div> and this is my javascript code: var geojson = [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-77.03238901390978,38.913188059745586] }, "properties": { "title": "Mapbox DC", "description": "1714 14th St NW, Washington DC", "marker-color": "#fc4353", "marker-size": "large", "marker-symbol": "monument" } },...

Openlayers: select a feature programmatically from GeoJson

openlayers,geojson
I am working on a project that uses openlayers (version2.14)to display a Bing layer(GeoJSON format), I have no problem reading the GeoJSON and display features, but I want to select a feature programmatically, for example, there is a table displaying all the features attributes(GeoJSON format.sample: {"type": "FeatureCollection", "features": [ {"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-7923751.4232522,5233536.7371399]},"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}...

Shapefile to Topojson conversion

geojson,shapefile,topojson
I am trying to convert the Ghana admin1 shapefile that can be found here. My end goal is to obtain a TopoJSON as described in this question. I have used this command on a Linux machine: ogr2ogr -f GeoJSON GHA_adm1.json GHA_adm1.shp And it returns this: Unable to open datasource `GHA_adm1.shp'...

How to convert geoJSON format from jsonp request to Open Layers 3 friendly format

jquery,jsonp,geojson,openlayers-3
I am using a jsonp request to a server which is returning a string containing the geometry of a multiline vector. This looks like this (I've truncated it a little): MULTILINESTRING((-0.61122 44.88987,-0.61108 44.88961,-0.6109 44.88926)) In Open Layers 3, when I usually create a vector feature I provide a string containing...

Lost data on geojson to topojson conversion

geojson,topojson
I grabbed a KML file of UK counties from this website. I then headed over to this other website to convert the KML to GeoJSON. All smooth so far. Then I wanted to convert the GeoJSON to its sibling format TopoJSON via the NodeJS package topojson. So I ran the...

Convert features of a 'multifeature' GeoJSON into R spatial objects

r,geojson,gdal,rgdal
Normally you can read geojson files into R with trusty readOGR, as illustrated here. However, this fails for multifeature geojsons. Reproducible example: downloader::download("https://github.com/Robinlovelace/Creating-maps-in-R/raw/master/data/test-multifeature.geojson", "test.geojson") test <- rgdal::readOGR("test.geojson", "OGRGeoJSON") # fails with: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Multiple incompatible geometries: wkbPoint:...

cant draw belgium on dc.js choropleth map

d3.js,geojson,dc.js,choropleth
I'm having trouble drawing belgium with a dc.js choropleth map. I've read it can be a projection problem in another stackoverflow response (map json works on Geojson.io but it doesnt work on dc.js choropleth map), but I can't find the right parameters to write. I would really appreciate any help...

If statement not being entered in for loop

javascript,json,geojson
I have a geojson file with earthquake point features that need to be styled based on the magnitude of the quake. The switch statement works correctly but it's a lot of code that I think could be done neater: switch (feature.properties.mag){ case 1.0 : return layer.setRadius(5); case 1.1 : return...

CesiumJS memory management issues

javascript,json,geojson,cesium
I am making a 3d model viwer in cesiumjs. The geojson is requested from the url and it works fine for small models. Incase of complex json multipolygon files and json url request data exceeds 16mb cesium takes so long in parsing and then rendering and if I make a...

Read data from geoJson file in ios

ios,objective-c,geojson
I'm trying to read data from geojson file using this code: NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"roads_json" ofType:@"geojson"]; NSDictionary *json = [NSJSONSerialization JSONObjectWithData:[[NSData alloc] initWithContentsOfFile:jsonPath] options:0 error:nil]; NSLog(@"points:%@",json); and the output: points:(null) any idea plz......

How to set custom icon for Leaflet Realtime plugin with Leaflet?

javascript,leaflet,geojson,markers
I'm new to Leaflet JS. I'm trying to figure out a way to change the default style for a L.Geojson marker used in Leaflet Realtime plugin. I don't know what property to change so that I can change the style of the markers. Here is my code so far: var...

GoogleMaps API: How to concatenate geoJSON properties with static text in infobox?

javascript,json,google-maps-api-3,geojson
I have a GoogleMaps page where I load geoJSON points into. These geoJSON points have a property called "waterlevel" which I want to display in an info-box when the cursor is on top of that point. I currently can get the info-box to update its "text" based on the waterlevel...

How to read GeoJSONP data in R?

r,geojson
I am learning R and I wanted to download earthquake data provided by the USGS to explore it with R. This is how I downloaded the data: >USGSdata<-fromJSON("http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojsonp") But if I do the following to get the attributes of the file: > names(USGSdata) I get : [1] "type" "metadata" "features"...

Calculating the percent overlap of two polygons in JavaScript

javascript,node.js,algorithm,geojson,topojson
Here's the problem: I have geoJSON and topoJSON files that give me the polygons for Census block groups and voting precincts. I'm trying to see by how much a given Census block group overlaps with a given precinct. I've seen a couple examples of what I'm after in other languages—i.e....

Django 1.8 Geojson

javascript,json,django,geojson
When serializing a model as geojson (https://docs.djangoproject.com/en/1.8/ref/contrib/gis/serializers/), how can you pass the primary key through? {"type": "FeatureCollection", "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}, "features": [{"type": "Feature", "properties": You would expect there to be a feature id using the models pk, based on the geojson standard, but there isn't. It's not...

How to add markers via GeoJSON to an existing layer, without having to reset it

maps,mapbox,geojson
I'm using mapbox. I have a layer that contains my markers: map = L.mapbox.map(id, map_id...) map.featureLayer # this is the layer containing all my markers What I want is to add markers to this layer without removing the existing ones. But I don't want to just create a marker via...

Angular cannot pass data to custom directive

angularjs,leaflet,geojson
My Directive angular .module('directoryAppMap') .directive('leafletDirective', function () { return { restrict: 'EA', scope: { data:'=' //I try to pass data by this scope// }, replace:true, template:'<div></div>', link: function (scope,element, attrs) { var map = L.map(attrs.id, { center: [40, -86], zoom: 2 }); //create a CloudMade tile layer and add it...

Adding geoJSON feature attribues to mapbox popup

javascript,gis,leaflet,mapbox,geojson
I am looking to add a popup with geoJSON attributes to each book store marker on my map. I have used "layer.feature.properties.name" within the marker.bindpopup method, but am getting a return of "undefined". L.mapbox.accessToken = 'jk.eyJ1IjsdkjfhskjdfhksdskdjflWNCJ9.Ov2O5PtskdljfsdR0lq3Q'; var map = L.mapbox.map('map', 'example.kks3kec4') .setView([38.633, -90.319],12); //add cafe, books store, and university geoJSON...

Finding if lat/long point is inside a polygon defined by coordinates

php,codeigniter,coordinates,kml,geojson
I am currently grabbing the KML used to define the polygons seen here. I am using the algorithm detailed in this answer to determine if the point is inside the polygon. The problem I have though is if the point is inside an empty part of the polygon, as seen...

Extending Highmaps Side Effect

javascript,jquery,highcharts,geojson
I am trying to create a dot density map of the state of Florida. While I know that Highmaps doesn't support color axis with mappoints. I extended it and it works but it comes with a side affect. When I click on one of the categories in the legend no...

Leaflet: Toggle GeoJSON layers with Checkboxes in custom sidebar

toggle,leaflet,geojson
I have a custom sidebar sitting on top of my map. Within the sidebar are checkboxes: <label><input type="checkbox" name="points" value="addressPoints" /> COUNTY</label> I would like the map to load with none of the GeoJSON layers pre-loaded and the functionality to toggle a layer on by clicking the checkbox. Below is...

How to print/display/draw a MultiPolygon GeoJSON on a Leaflet map

javascript,angularjs,leaflet,geojson
I'm trying to display a GeoJSON MultiPolygon object in a Leaflet map. I get it from a PostgreSQL database as a JSON and I trnasform it to a GeoJSON. I've validated de MultiPolygon object in GeoJSONLint and it's ok: But I'm not able to accomplish this in my app =(...

GeoJSON tiles regression in v3.5.0

geojson,openlayers-3
My vector tiles were rendered correctly up to version 3.4, but nothing is displayed in 3.5. There are no errors in the JS console. I haven't found any related changes in the most recent API. Is it a bug? var tileVectorSource = new ol.source.TileVector({ format: new ol.format.GeoJSON(), tileGrid: new ol.tilegrid.XYZ({...

Openlayers 3.5 and GeoJSON

gis,geojson,openlayers-3
I'm having a problem with OpenLayers 3.5. I'm trying to use the one-off loading strategy to grab features from a GeoJSON file. I'm adding a new layer to an already instantiated map. My code looks like this: var vectorSource = new ol.source.Vector({ url: layerInfo.url, format: new ol.format.GeoJSON() }); var pointsLayer...

Adding images to an info window from a GeoJSON file? Google maps javascript API

javascript,google-maps,google-maps-api-3,geojson,infowindow
Basically, I want to display an info window from a marker that can show several information from a GeoJSON file, such as date, hour and type of event (I can do all of this by now)... but I also need a specific image for each marker info window. var infowindow...

How to set the marker color when using geojson.Feature

colors,geojson,marker
I am using python and my code is like: from geojson import Feature, FeatureCollection import json import sys, pymongo db = pymongo.MongoClient(host = '..........').database coll_name = sys.argv[1] point_list = [] citymap_cursor = db[coll_name].find() for doc in citymap_cursor: point_list.append(Feature(geometry=doc['point_latlng'])) with open('/path to/%s.json' % coll_name, 'w+') as outfile: json.dump(FeatureCollection(point_list), outfile) By this...

Why does itunecconnect not accept my geoJSON file?

itunesconnect,geojson
My file is { "type": "MultiPolygon", "coordinates": [ [[[37.2732892, 55.9551567], [37.8780522, 55.9633486], [37.993164, 55.5512744], [37.1913337,55.5559836]]] ] } This site shows than it is ok. http://geojsonlint.com/ However, itunesconnect does not accept. Please help...

Convert a newly created polygon to GeoJSON in Leaflet

javascript,leaflet,geojson
I create polygons of different sizes by clicking a button in my webapp. I also add some values inside the object as a nested object, like {properties:{status:'active'}}. Then I run toGeoJSON() method of the polygon and get an object with properties and geometry objects. properties object is empty. My question...

From geoJSON to Array

javascript,arrays,json,multidimensional-array,geojson
The real issue was that i could not seem to be able to set the value inside the coordinates. The start of the JSON looks something like this. { "path":{ "type":"FeatureCollection", "features":[ { "geometry":{ "type":"LineString", "coordinates":[ [ 10.4048129700337, 63.416688738540316 ], [ 10.404757623420094, 63.4167327334674 ] ] }, "type":"Feature", "id":85624, "properties":{ "flags":[...

filter geojson by date

node.js,geojson
Is it possible to filter GeoJson data by date, now I only save the position in Mongoose. But I want to make some filters like, show position the last day, the last week, the last month and random dates. From the documentation of GeoJson I read that date is not...

GeoJSON --> TopoJSON conversion for Point geometries?

geojson,topojson
I am trying to use the command-line topojson tool from Mike Bostock to convert a GeoJSON feature collection with Point features to TopoJSON, but coordinates in the input files does not seem to be picked up correctly since output coordinates turn out as [null,null] in the output. The GeoJSON file...

Can`t draw borders on google map

javascript,google-maps,google-maps-api-3,geojson
I am trying to draw borders for certain countries on a google map using some geojson data. I've added the entire geojson in an array at the beginning of the js file. The problem I encounter is that for certain countries the borders aren't drawn at all. For ex: Canada,...

Routing between places with mapbox or similar direction api

openstreetmap,mapbox,geojson
I have a geoJSON objects and I want to route between waypoints on my geoJSON file. { "type":"FeatureCollection", "generator":"JOSM", "bbox":[ 23.4668, 58.9198, 23.6412, 58.974 ], "features":[ { "type":"Feature", "properties":{ "wheelchair":"yes", "smoothness":"bad", "surface":"crushed stones" }, "geometry":{ "type":"Point", "coordinates":[ 23.53359252, 58.95034587858 ] } }, { "type":"Feature", "properties":{ "wheelchair":"yes", "addr:housename":"Saue kohvik", "amenity":"pub", "name":"Saue...

mapbox geojson properties not available on hover

javascript,leaflet,mapbox,geojson
I'm using mapbox and loading multiple geojson layers on to the map, like so: ... var aLayer = L.mapbox.featureLayer('/a.geojson'); var bLayer = L.mapbox.featureLayer('/b.geojson'); var cLayer = L.mapbox.featureLayer('/c.geojson'); var layers = { LayerA: aLayer, LayerB: bLayer, LayerC: cLayer } ... layers.LayerA.addTo(map).on('ready', function(e) { map.fitBounds(LayerA.getBounds(), {animate: true}); }); L.control.layers(layers).addTo(map); Each geojson feature...

D3.geo : responsive frame given a geojson object?

dictionary,d3.js,geojson,topojson
I use Mike Bostock's code to Center a map in d3 given a geoJSON object. The important part of the code is this: var width = 960, height = 500; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); d3.json("/d/4090846/us.json", function(error, us) { var states = topojson.feature(us, us.objects.states), state = states.features.filter(function(d)...