I have a table in Google Maps Engine that I would like to update dynamically with JavaScript in a Google Site. I've found this help page that explains how to append features to an existing table, but I'm struggling to figure out how to modify the code so that it will update the table instead of append to it. I believe I specifically need to modify the processResponse
and processErrorResponse
functions. However, I'm fairly new to JavaScript/jQuery/JSON, and I'm not exactly sure how to determine what I should have instead of #insert-table-features-response
. Is there someone here that could explain that to me?
Edit: To put it another way, how can I make the request shown below with JavaScript?
POST https://www.googleapis.com/mapsengine/v1/tables/{YOUR_TABLE_KEY}/features/batchPatch?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer {. . .}
X-JavaScript-User-Agent: Google APIs Explorer
{
"features": [
{
"geometry": {
"type": "Point",
"coordinates": [
-82,
35
]
},
"properties": {
"Lat": 35,
"Long": -82,
"Name": "6:41:13 AM 11/27/14",
"gx_id": "123ABC456DEF7890"
}
}
]
}
Aucun commentaire:
Enregistrer un commentaire