Skip to content

Commit

Permalink
Notebook API
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jul 11, 2024
1 parent ca09715 commit ad67581
Show file tree
Hide file tree
Showing 6 changed files with 279 additions and 31 deletions.
23 changes: 19 additions & 4 deletions examples/Notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,32 @@
"metadata": {},
"outputs": [],
"source": [
"doc = GISDocument()"
"doc = GISDocument(\"france_hiking.jGIS\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a0314dc6-9d79-4361-8b86-60b84f543cf9",
"id": "5938ba70-36d7-4af3-b877-815464ef6d1a",
"metadata": {},
"outputs": [],
"source": [
"doc"
"doc.add_raster_layer(\n",
" url=\"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}\",\n",
" name=\"Google Satellite\",\n",
" attribution=\"Google\",\n",
" opacity=0.6\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69ac2a9a-d9a9-4170-b1f5-451b9fd5780e",
"metadata": {},
"outputs": [],
"source": [
"doc.add_geojson_layer(path=\"examples/france_regions.json\")"
]
}
],
Expand All @@ -63,7 +78,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
28 changes: 15 additions & 13 deletions packages/schema/src/schema/jgis.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"$ref": "#/definitions/layerType"
},
"visible": {
"type": "boolean"
"type": "boolean",
"default": true
},
"parameters": {
"type": "object"
Expand Down Expand Up @@ -80,13 +81,25 @@
}
},
"visible": {
"type": "boolean"
"type": "boolean",
"default": true
},
"parameters": {
"type": "object"
}
}
},
"jGISLayerItem": {
"title": "IJGISLayerItem",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/jGISLayerGroup"
}
]
},
"jGISLayers": {
"title": "IJGISLayers",
"type": "object",
Expand Down Expand Up @@ -131,17 +144,6 @@
"default": 0
}
}
},
"jGISLayerItem": {
"title": "IJGISLayerItem",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/jGISLayerGroup"
}
]
}
}
}
3 changes: 2 additions & 1 deletion packages/schema/src/schema/rasterlayer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"properties": {
"source": {
"type": "string",
"description": "The id of the source"
"description": "The id of the source",
"default": ""
},
"opacity": {
"type": "number",
Expand Down
19 changes: 13 additions & 6 deletions packages/schema/src/schema/rastersource.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,34 @@
"minimum": 0,
"maximum": 24,
"readOnly": true,
"description": "The maximum zoom level for the raster source"
"description": "The maximum zoom level for the raster source",
"default": 24
},
"minZoom": {
"type": "number",
"minimum": 0,
"maximum": 24,
"readOnly": true,
"description": "The minimum zoom level for the raster source"
"description": "The minimum zoom level for the raster source",
"default": 0
},
"attribution": {
"type": "string",
"readOnly": true,
"description": "The attribution for the raster source"
"description": "The attribution for the raster source",
"default": ""
},
"htmlAttribution": {
"type": "string",
"readOnly": true,
"description": "The html attribution for the raster source"
"description": "The html attribution for the raster source",
"default": ""
},
"provider": {
"type": "string",
"readOnly": true,
"description": "The map provider"
"description": "The map provider",
"default": ""
},
"bounds": {
"type": "array",
Expand All @@ -47,13 +52,15 @@
"type": "number"
}
},
"default": [],
"description": "The bounds of the source"
},
"urlParameters": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"default": {}
}
}
}
Loading

0 comments on commit ad67581

Please sign in to comment.