{"id":13497460,"url":"https://github.com/kuflink/angular2-mapbox","last_synced_at":"2025-03-28T22:31:44.972Z","repository":{"id":57179649,"uuid":"75823802","full_name":"kuflink/angular2-mapbox","owner":"kuflink","description":"Angular 2 components for mapbox-gl","archived":true,"fork":false,"pushed_at":"2019-03-07T06:28:29.000Z","size":111,"stargazers_count":17,"open_issues_count":8,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T20:41:22.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuflink.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":"2016-12-07T10:09:04.000Z","updated_at":"2024-11-04T07:43:43.000Z","dependencies_parsed_at":"2022-09-14T03:30:41.320Z","dependency_job_id":null,"html_url":"https://github.com/kuflink/angular2-mapbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuflink%2Fangular2-mapbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuflink%2Fangular2-mapbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuflink%2Fangular2-mapbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuflink%2Fangular2-mapbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuflink","download_url":"https://codeload.github.com/kuflink/angular2-mapbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246110212,"owners_count":20725011,"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":"2024-07-31T20:00:31.230Z","updated_at":"2025-03-28T22:31:44.665Z","avatar_url":"https://github.com/kuflink.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# angular2-mapbox\n\n[![Join the chat at https://gitter.im/kuflink/angular2-mapbox](https://badges.gitter.im/kuflink/angular2-mapbox.svg)](https://gitter.im/kuflink/angular2-mapbox?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nAngular2 components for [mapbox-gl](https://www.npmjs.com/package/mapbox-gl). This project is currently in development state. Please do not use this in production.\n\n## Install\n\n```bash\nnpm install --save angular2-mapbox\n```\n\nInside your @NgModule, add the MapBoxModule along with your API key for Mapbox ([you can grab one here](https://www.mapbox.com/studio/account/tokens/)):\n\n```javascript\nimport { NgModule }      from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { AppComponent }  from './app.component';\n\nimport { MapBoxModule }  from 'angular2-mapbox/core';\n\n@NgModule({\n  imports: [ \n    BrowserModule, \n    MapBoxModule.forRoot(\"REPLACE_WITH_YOUR_API_KEY\")\n  ],\n  declarations: [ AppComponent ],\n  bootstrap:    [ AppComponent ]\n})\nexport class AppModule { }\n```\n\nNow added the map for [mapbox-gl](https://www.npmjs.com/package/mapbox-gl) and angular2-mapbox in your **system.config.js**\n\n```javascript\n(function (global) {\n  System.config({\n    paths: {\n      'npm:': 'node_modules/'\n    },\n    map: {\n      ...\n      'mapbox-gl': 'npm:mapbox-gl/dist/mapbox-gl.js',\n      'angular2-mapbox/core': 'npm:angular2-mapbox/core/core.umd.js'\n    },\n    ...\n})(this);\n```\n\nLastly, we need to include the mapbox-gl css file. You can do this via @import or including it as a stylesheet in your HTML.\n\n```\n@import \"node_modules/mapbox-gl/dist/mapbox-gl\";\n```\n\nOR \n\n```html\n\u003clink rel=\"stylesheet\" href=\"node_modules/mapbox-gl/dist/mapbox-gl.css\"/\u003e\n```\n\n## Usage\n\nNow you can start using the angular2 mapbox components.\n\n### mapbox[options]\n\n```html\n\u003cmapbox [options]=\"myMapboxOptions\"\u003e\u003c/mapbox\u003e\n```\n\n`options` should be use the interface `MapOptions` which is exported by this package.\n\n* style: string, defaultsTo = **'mapbox://styles/mapbox/streets-v9'**\n* center: array, defaultsTo = **[-5.646973, 52.087483]**\n* zoom: number, defaultsTo = **6**\n* hash: boolean, defaultsTo = **false**\n* index: number, defaultsTo = **0** (NOTE: Must be used if multiple maps are displayed)\n\n### mapbox-marker[_image, width, height, coordinates, click, data, flyTo_]\n\n```html\n\u003cmapbox [center]=\"[-5.646973, 52.087483]\"\u003e\n    \u003cmapbox-marker\n        *ngFor=\"let marker of map.markers\"\n        flyTo=\"16\"\n        [image]=\"marker.image\"\n        [coordinates]=\"marker.coordinates\"\n        [popup]=\"marker.popup\"\n        [data]=\"marker.data\"\n        (click)=\"markerClicked($event)\"\u003e\n    \u003c/mapbox-marker\u003e\n\u003c/mapbox\u003e\n```\n\n* image: string\n* width: number = defaultsTo = **60**\n* height: number = defaultsTo = **60**\n* coordinates: array \n* click: function\n* data: [object, string]\n* flyTo: number (If present, when clicked the marker is flown to)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuflink%2Fangular2-mapbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuflink%2Fangular2-mapbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuflink%2Fangular2-mapbox/lists"}