{"id":20515623,"url":"https://github.com/ignf/ol-geometry-editor","last_synced_at":"2026-03-01T16:02:16.740Z","repository":{"id":41757044,"uuid":"222429387","full_name":"IGNF/ol-geometry-editor","owner":"IGNF","description":"Outil d'édition et de visualisation des géométries","archived":false,"fork":false,"pushed_at":"2025-04-11T16:18:02.000Z","size":2567,"stargazers_count":2,"open_issues_count":12,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-11T17:30:27.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IGNF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-18T11:07:09.000Z","updated_at":"2025-04-11T16:16:53.000Z","dependencies_parsed_at":"2023-02-09T17:46:18.234Z","dependency_job_id":null,"html_url":"https://github.com/IGNF/ol-geometry-editor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IGNF/ol-geometry-editor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IGNF%2Fol-geometry-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IGNF%2Fol-geometry-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IGNF%2Fol-geometry-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IGNF%2Fol-geometry-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IGNF","download_url":"https://codeload.github.com/IGNF/ol-geometry-editor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IGNF%2Fol-geometry-editor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29974321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T15:41:30.362Z","status":"ssl_error","status_checked_at":"2026-03-01T15:37:07.343Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T21:23:35.062Z","updated_at":"2026-03-01T16:02:16.721Z","avatar_url":"https://github.com/IGNF.png","language":"JavaScript","readme":"# ol-geometry-editor\n\n## Description\n\n\u003e Ce composant fournit un moyen simple d'intégrer une composante géométrique dans les formulaires HTML.\n\u003e Nul besoin de révolutionner votre architecture, d'intégrer des `Feature` et `FeatureCollection` :\n\u003e Une géométrie est un champ comme un autre qui peut être formaté en texte et édité à l'aide d'une carte.\n\nThis components provides an easy way to integrate geometry edition in HTML forms.\n\n## How to enable a geometry editor ?\n\nGiven \"the_geom\" input in a form :\n\n```html\n\u003ctextarea class=\"geometry\"\u003e\n{\"type\":\"Point\",\"coordinates\":[2.33,48.85]}\n\u003c/textarea\u003e\n```\n\nEither use jQuery plugin :\n\n```javascript\n$('.geometry').geometryEditor({\n    geometryType: 'Point',\n    editable: true\n});\n\nlet geometryEditor = $(\"#geometry_pluggin_span\").data('editor');\n```\n\n\nOr the `GeometryEditor` class :\n\n```javascript\nvar geometryEditor = new ge.GeometryEditor(document.getElementById(\"geometry\"), {\n    geometryType: 'Point',\n    editable: true\n});\n```\n\n=\u003e GeoJSON geometry will be hidden and a map will be provided as edition widget (option \"hide\" can change this).\n\nSee the list of options below.\n\n\n## Main components\n\n* `ge.GeometryEditor` : class providing a geometry editor\n* `$.geometryEditor` : jQuery plugin\n\n\n## Options\n\n| Option                 | Description                                                     | Default                  |\n| ---------------------- | --------------------------------------------------------------- | ------------------------ |\n| `geometryType`         | Restrict geometry type                                          | `Geometry`               |\n| `hide`                 | true to hide form input                                         | `true`                   |\n| `editable`             | Allows to enable a viewer mode without geometry edition         | `true`                   |\n| `tileLayers`           | init background map                                             | `tile.openstreetmap.org` |\n| `tileLayerSwitcher`    | true to put layers in a layerSwitcher                           | `false`                  |\n| `switchableLayers`     | mapping to put more than one layer by tile in layer switcher    |  []                      |\n| `tileCoordinates`      | Coordinates of the image for the layer switcher                 | `[9, 253, -177]`         |\n| `width`                | Map width                                                       | `100%`                   |\n| `height`               | Map height                                                      | `500`                    |\n| `lon`                  | Longitude for initial view                                      | `2.0`                    |\n| `lat`                  | Latitude for initial view                                       | `45.0`                   |\n| `zoom`                 | Zoom for initial view                                           | `4`                      |\n| `maxZoom`              | Maximum zoom level                                              | `20`                     |\n| `minZoom`              | Minimum zoom level                                              | `4`                      |\n| `centerOnResults`      | Zoom to geometry after each edition                             | `true`                   |\n| `precision`            | Maximum number of decimal for coordinates                       | `7`                      |\n| `allowCapture`         | Add map control to show and save a capture of the map           | `false`                  |\n| `style`                | Custom ol.style.style or ol.StyleFunction of geometry layer     | `undefined`              |\n\n\n\n## Get the map object and custom events :\n\n```javascript\n\n    var geometryEditor = $(\".geometry\").data('editor');\n    var map = geometryEditor.getMap();\n\n    // when the tile of background layers change\n    map.on('change:tile',function(e){\n        console.log(e.tile);\n    });\n\n    // When the geometry change\n    map.on('change:geometry',function(e){\n        console.log(e.geometry);\n    });\n\n```\n\n## Add a layer switcher :\n\n```javascript\n$('.geometry').geometryEditor({\n    geometryType: 'Point',\n\n    // add layers to the map with this option\n    tileLayers: [\n                    {\n                        'title': 'OSM',\n                        'url': 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n                        'attribution': '©\u003ca href=\"http://openstreetmap.org\"\u003eOpenStreetMap contributors\u003c/a\u003e'\n                    },\n                    {\n                        'title': 'Wikipedia',\n                        'url': 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'\n                    }\n    ],\n\n    // allow to show the layer switcher\n    'tileLayerSwitcher': true,\n\n    // by default, one layer by switch,but you can add multiple layers to one switch with this mapping option\n    'switchableLayers': [\"OSM\",\"Wikipedia\",[\"OSM\",\"Wikipedia\"]]\n\n    // the switch active by default at load\n    'defaultSwitchableTile': 1,\n\n    // each switch got an image based on a tile of the layer(s) assigned to him,\n    // you can configure the coordinates with this option\n    'tileCoordinates': [9, 269, -189], //corse\n});\n```\n\n## Supported geometry types (option \"geometryType\")\n\n* `Point`\n* `LineString`\n* `Polygon`\n* `MultiPoint`\n* `MultiLineString`\n* `MultiPolygon`\n* `Rectangle`\n* `Geometry` (no restriction, `GeometryCollection` if required)\n\n![Supported geometry types](doc/images/geometry-types.png)\n\n## Get started\n\nSee [index.html](https://ignf.github.io/ol-geometry-editor/index.html)\n\n## Dependencies\n\n* jQuery \u003e= 1.12.0\n* openlayers \u003e= 4.6.4 and openlayers \u003c 5.0.0\n\n## License\n\nSee [LICENCE.md](LICENCE.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignf%2Fol-geometry-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignf%2Fol-geometry-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignf%2Fol-geometry-editor/lists"}