Note that there are some explanatory texts on larger screens.

plurals
  1. POAttempting to format json data with PHP to use with Polymaps
    primarykey
    data
    text
    <p>Okay I'm attempting to use php to encode a json file I'm subsequently using to draw a map with the Polymaps service.</p> <p>I'm having trouble when encoding my json from the Instagram API -- I'm able to do it, but I need the structure to be nested in this certain way. My code I have now encodes it in this format: </p> <pre><code>[ { "title":"some value", "src":"some value", "lat":"some value", "lon":"some value" }, ... </code></pre> <p>So on and so forth. I need the format to match something more like this: </p> <pre><code>{ "type":"FeatureCollection", "features":[ { "type":"Feature", "geometry":{ "coordinates":[ -94.34885, 39.35757 ], "type":"Point" }, "properties":{ "latitude":39.35757, "title":"Kearney", "id":919, "description":"I REALLY need new #converse, lol. I've had these for three years. So #destroyed ! :( Oh well. Can't wait to get a new pair and put my #rainbow laces through. #gay #gaypride #bi #proud #pride #colors #shoes #allstar #supporting ", "longitude":-94.34885, "user":"trena1echo5", "image":"http://images.instagram.com/media/2011/09/09/ddeb9bb508c94f2b8ff848a2d2cd3ece_7.jpg", "instagram_id":211443415 } }, { "type":"Feature", "geometry":{ "coordinates":[ -0.09402781, 51.51512 ], "type":"Point" }, "properties":{ "latitude":51.51512, "title":"City Of London", "id":918, "description":"#destroyed", "longitude":-0.09402781, "user":"axxoul", "image":"http://distillery.s3.amazonaws.com/media/2011/09/09/ffda47fb97924a41bc36b0b024fcdfad_7.jpg", "instagram_id":211074717 } }, </code></pre> <p>...with its nested structure. I have the jquery working to read from the json file and the php script written to make the json...this is the last puzzle piece for me. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload