Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Fixed GeoJSON. Missing close poly point.
Browse files Browse the repository at this point in the history
  • Loading branch information
alaframboise committed Nov 8, 2013
1 parent 11d0cb1 commit 5998620
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions examples/browser/arcgis-interactive-loader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
<div class="tab-content">

<div id="geojson" class="tab-pane active">
<textarea placeholder="GeoJSON" data-type="geojson">{"type":"FeatureCollection","properties":{"kind":"state","state":"OR"},"features":[ {"type":"Feature","properties":{"kind":"county","name":"Washington","state":"OR"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-123.1347,45.7798],[-123.0306,45.7798],[-123.0306,45.7524],[-122.9265,45.7250],[-122.9265,45.6319],[-122.7458,45.5169],[-122.7458,45.4348],[-122.7458,45.3307],[-122.8444,45.3471],[-122.8663,45.3197],[-123.0635,45.4019],[-123.1347,45.4348],[-123.4633,45.4348],[-123.4852,45.4457],[-123.4414,45.5224],[-123.2990,45.5936],[-123.4852,45.6812],[-123.4852,45.7086],[-123.3592,45.7086],[-123.3592,45.7798]]]]}} ]}</textarea>
<textarea placeholder="GeoJSON" data-type="geojson">{"type":"FeatureCollection","properties":{"kind":"state","state":"OR"},"features":[ {"type":"Feature","properties":{"kind":"county","name":"Washington","state":"OR"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-123.1347,45.7798],[-123.0306,45.7798],[-123.0306,45.7524],[-122.9265,45.7250],[-122.9265,45.6319],[-122.7458,45.5169],[-122.7458,45.4348],[-122.7458,45.3307],[-122.8444,45.3471],[-122.8663,45.3197],[-123.0635,45.4019],[-123.1347,45.4348],[-123.4633,45.4348],[-123.4852,45.4457],[-123.4414,45.5224],[-123.2990,45.5936],[-123.4852,45.6812],[-123.4852,45.7086],[-123.3592,45.7086],[-123.3592,45.7798],[-123.1347,45.7798]]]]}} ]}</textarea>
</div>

<div id="wkt" class="tab-pane">
<textarea placeholder="WKT" data-type="wkt">MULTIPOLYGON (((-122.9265 45.725, -122.7622 45.7305, -122.7622 45.6593, -122.6746 45.6155, -122.2474 45.5498, -121.9243 45.6484, -121.9024 45.5552, -121.9243 45.5443, -121.8202 45.4621, -122.3569 45.4621, -122.7458 45.4348, -122.7458 45.5169, -122.9265 45.6319)))</textarea>
<textarea placeholder="WKT" data-type="wkt">MULTIPOLYGON (((-122.9265 45.725, -122.7622 45.7305, -122.7622 45.6593, -122.6746 45.6155, -122.2474 45.5498, -121.9243 45.6484, -121.9024 45.5552, -121.9243 45.5443, -121.8202 45.4621, -122.3569 45.4621, -122.7458 45.4348, -122.7458 45.5169, -122.9265 45.6319, -122.9265 45.725)))</textarea>
</div>

<div id="arcgis" class="tab-pane">
<textarea placeholder="ArcGIS" data-type="arcgis">{"geometry":{"rings":[[[-122.7458,45.4348],[-122.7458,45.3307],[-122.8444,45.3471],[-122.8663,45.3197],[-122.8499,45.2595],[-122.7403,45.2595],[-122.7896,45.128],[-122.5979,45.0185],[-122.5048,44.9199],[-122.3953,44.8871],[-121.7326,44.8871],[-121.7161,44.9035],[-121.7983,44.9363],[-121.8038,45.013],[-121.6614,45.0678],[-121.6669,45.1171],[-121.6997,45.1226],[-121.749,45.1992],[-121.6833,45.2266],[-121.6942,45.2595],[-121.6997,45.38],[-121.7764,45.4019],[-121.8202,45.4621],[-122.3569,45.4621]]],"spatialReference":{"wkid":4326}},"attributes":{"kind":"county","name":"Clackamas","state":"OR"}}</textarea>
<textarea placeholder="ArcGIS" data-type="arcgis">{"geometry":{"rings":[[[-122.7458,45.4348],[-122.7458,45.3307],[-122.8444,45.3471],[-122.8663,45.3197],[-122.8499,45.2595],[-122.7403,45.2595],[-122.7896,45.128],[-122.5979,45.0185],[-122.5048,44.9199],[-122.3953,44.8871],[-121.7326,44.8871],[-121.7161,44.9035],[-121.7983,44.9363],[-121.8038,45.013],[-121.6614,45.0678],[-121.6669,45.1171],[-121.6997,45.1226],[-121.749,45.1992],[-121.6833,45.2266],[-121.6942,45.2595],[-121.6997,45.38],[-121.7764,45.4019],[-121.8202,45.4621],[-122.3569,45.4621],[-122.7458,45.4348]]],"spatialReference":{"wkid":4326}},"attributes":{"kind":"county","name":"Clackamas","state":"OR"}}</textarea>
</div>

<br>
Expand Down
7 changes: 0 additions & 7 deletions examples/browser/arcgis-interactive-loader/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,12 @@ require([
return sfs;
}

function addLastPoint(geometry) {
var pt = geometry.rings[0][0];
geometry.rings[0].push(pt);
}

function addGraphic(arcgis,color){
// if arcgis.geometry is set we have a graphic json
// else we can create our own json and set the symbol on it.
if(arcgis.geometry){
addLastPoint(arcgis.geometry);
shape = new esri.Graphic(arcgis).setSymbol(getSymbol(color));
} else {
addLastPoint(arcgis);
shape = new esri.Graphic({
geometry: arcgis
}).setSymbol(getSymbol(color));
Expand Down

0 comments on commit 5998620

Please sign in to comment.