{"id":24988715,"url":"https://github.com/maptalks/maptalks.esri","last_synced_at":"2025-04-12T00:10:31.933Z","repository":{"id":26976976,"uuid":"112064576","full_name":"maptalks/maptalks.esri","owner":"maptalks","description":"A maptalks plugin to load esri ArcGIS services.","archived":false,"fork":false,"pushed_at":"2024-12-05T08:50:31.000Z","size":1088,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-05T11:16:31.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maptalks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-26T07:37:32.000Z","updated_at":"2024-12-05T08:50:35.000Z","dependencies_parsed_at":"2024-06-21T05:43:47.313Z","dependency_job_id":"1ee32634-53f4-4645-b7d9-8563b9028f0b","html_url":"https://github.com/maptalks/maptalks.esri","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":0.5689655172413793,"last_synced_commit":"31df4e8378d42a4495a145288798d4dc7bbe2aa1"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.esri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.esri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.esri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.esri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptalks","download_url":"https://codeload.github.com/maptalks/maptalks.esri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237111680,"owners_count":19257389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2025-02-04T12:05:09.012Z","updated_at":"2025-02-04T12:05:09.952Z","avatar_url":"https://github.com/maptalks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# maptalks.esri\n\nA plugin to load ArcGIS service.\n\n## Demo\n\n* [FeatureLayerService's Demo](https://maptalks.org/maptalks.esri/demo/FeatureLayer.html)\n* [FeatureLayerService Dynamic Condition Demo](https://maptalks.org/maptalks.esri/demo/FeatureLayer-where.html)\n* [ImageLayerService Demo](https://maptalks.org/maptalks.esri/demo/ImageLayer.html)\n* [IdentifyService Demo](https://maptalks.org/maptalks.esri/demo/identify.html)\n* [DynamicMapLayer Demo](https://maptalks.org/maptalks.esri/demo/DynamicMapLayer.html)\n* [DynamicMapLayer 4326 Demo](https://maptalks.org/maptalks.esri/demo/DynamicMapLayer-4326.html)\n\n## Install\n\n```shell\nnpm i maptalks.esri --save\n```\n\n## Usage\n\n### In Browser\n```html\n\u003cscript src=\"https://unpkg.com/maptalks/dist/maptalks.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/maptalks.esri/dist/maptalks.esri.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n    const service = new maptalks.esri.FeatureLayerService(/* params */);\n    const service1 = new maptalks.esri.ImageLayerService(/* params */);\n\u003c/script\u003e\n```\n\n### ESM Module\n\n```js\nimport { FeatureLayerService, ImageLayerService } from 'maptalks.esri';\nconst service = new FeatureLayerService(/* params */);\nconst service1 = new ImageLayerService(/* params */);\n```\n\n## Code samples\n\n### Load FeatureLayer Service\n\n```js\nconst service = new maptalks.esri.FeatureLayerService({\n    url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer/0',\n    // 数据的坐标系，不设置时则默认使用map的坐标系，如果设置，则会按该坐标系转换为map的坐标系\n    // projection: 'EPSG:3857',\n    symbol: {\n        markerType: 'ellipse',\n        markerWidth: 12,\n        markerHeight: 12,\n        markerFill: '#f00',\n        markerFillOpacity: 0.5,\n        markerLineColor: '#000',\n        markerLineWidth: 2\n    }\n});\n\nconst pointLayer = new maptalks.PointLayer('polygon');\nconst groupLayer = new maptalks.GroupGLLayer('group', [pointLayer]).addTo(map);\n\nfunction query() {\n    const extent = map.getExtent();\n    const geometry = [extent.xmin, extent.ymin, extent.xmax, extent.ymax].join(',');\n    service.query({\n        geometry: geometry,\n        geometryType: 'esriGeometryEnvelope'\n    }).then(json =\u003e {\n        json = JSON.parse(json);\n        console.log('fetures count:', json.features.length);\n        const geometries = service.toGeometry(json);\n        pointLayer.clear();\n        pointLayer.addGeometry(geometries);\n                // map.setCenterAndZoom(extent.getCenter(), zoom);\n    });\n}\nmap.on('viewchange', query);\nquery();\n```\n\n### Load Image Map Service\n\n```js\n\nvar service = new maptalks.esri.ImageLayerService({\n    url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer/export',\n    debug: true,\n    map,\n    // 数据的坐标系，不设置时则默认使用map的坐标系，如果设置，则会按该坐标系转换为map的坐标系\n    // projection: 'EPSG:3857',\n});\n\n var imageLayer = new maptalks.ImageLayer('imagemaplayer');\n map.addLayer(imageLayer);\n\nfunction query() {\n    service.query().then(json =\u003e {\n        json = JSON.parse(json);\n        if (json.href) {\n            const extent = map.getExtent();\n            const geometry = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];\n            imageLayer.setImages([{\n                url: json.href,\n                    extent: geometry\n                }]);\n        }\n    })\n}\n\n map.on('viewchange', query);\n query();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptalks%2Fmaptalks.esri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptalks%2Fmaptalks.esri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptalks%2Fmaptalks.esri/lists"}