# What is wrong with my geoJSON?

**URL:** <https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511>\
**Category:** CesiumJS\
**Created:** [September 20, 2014, 11:25am UTC](https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511 "2014-09-20T11:25:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed.hammod](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.hammod](https://community.cesium.com/u/mohamed.hammod)\
**Post date:** [September 20, 2014, 11:25am UTC](https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511/1 "2014-09-20T11:25:38Z")

</div>

The geoJSON sandcastle examples runs perfectly with me, but when I use my own geoJSON file as a data source nothing appear. Please help:

Below is my geoJSON data source:

{ "type": "Feature", "properties": { "OBJECTID": 20, "ENGID": "40RBN5319301351"}, "geometry": { "type": "Polygon", "coordinates": [[ [ 54.566124539478878, 24.406021338476325], [54.566148107752099, 24.406028017955055], [54.566115732828465, 24.406123836089698], [54.566235456768659, 24.406157760188982], [54.566255574031182, 24.406098193520144], [54.566281975778445, 24.406105667739457], [54.566279060022957, 24.406114304250391], [54.566329951512451, 24.406128725476261], [54.566371950924683, 24.406004421274567], [54.566292775469798, 24.405981990105861], [54.566286944486251, 24.405999236057994], [54.566270925041493, 24.405994699916651], [54.566268584486721, 24.406001612608108], [54.566239349486047, 24.405993334604545], [54.566241680361216, 24.405986412731547], [54.566182308651392, 24.405969589467993], [54.566175004474289, 24.405991180502262], [54.566138240189531, 24.405980768499898], [54.566124539478878, 24.406021338476325] ] ] } }

and below is the source code:

//Create the viewer  
var viewer = new Cesium.Viewer('cesiumContainer');  
Cesium.viewerEntityMixin(viewer);

var dataSource = new Cesium.GeoJsonDataSource();  
viewer.dataSources.add(dataSource);  
dataSource.loadUrl('../../SampleData/bldgs.geojson');

---

<div class="post-metadata">

**Author:** ![mohamed.hammod](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.hammod](https://community.cesium.com/u/mohamed.hammod)\
**Post date:** [September 21, 2014, 4:27am UTC](https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511/2 "2014-09-21T04:27:43Z")

</div>

Even the original geojson example is not working when I run it locally.

Any idea?

---

<div class="post-metadata">

**Author:** ![mohamed.hammod](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.hammod](https://community.cesium.com/u/mohamed.hammod)\
**Post date:** [September 21, 2014, 10:34am UTC](https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511/3 "2014-09-21T10:34:44Z")

</div>

By the way, I am using IIS as a web server, and following is the error I got when running the application using Chrom:

XMLHttpRequest cannot load [http://hqtpssdd0082d/Cesium/Apps/Sandcastle/ne\_10m\_us\_states.topojson](http://hqtpssdd0082d/Cesium/Apps/Sandcastle/ne_10m_us_states.topojson). No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '[http://localhost:52956](http://localhost:52956)' is therefore not allowed access. GeoJSON.html:1

---

<div class="post-metadata">

**Author:** ![Scott\_Hunter](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_hunter/32/2006_2.png) [@Scott\_Hunter](https://community.cesium.com/u/Scott_Hunter)\
**Post date:** [September 23, 2014, 2:55pm UTC](https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511/4 "2014-09-23T14:55:12Z")

</div>

IIS by default does not serve file extensions that it doesn’t recognize. This includes .geojson and .topojson files. You have to configure it to tell it the correct MIME type to use for those extensions. [http://stackoverflow.com/questions/8158193/how-to-allow-download-of-json-file-with-asp-net](http://stackoverflow.com/questions/8158193/how-to-allow-download-of-json-file-with-asp-net)

Also, if you want to load files from a different server, you will also need to enable CORS headers on the server hosting the data file. [http://enable-cors.org/server\_iis7.html](http://enable-cors.org/server_iis7.html)

---

<div class="post-metadata">

**Author:** ![mohamed.hammod](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.hammod](https://community.cesium.com/u/mohamed.hammod)\
**Post date:** [September 24, 2014, 6:44am UTC](https://community.cesium.com/t/what-is-wrong-with-my-geojson/1511/5 "2014-09-24T06:44:12Z")

</div>

Many thanks Scott Hunter, it is working now.
