ngx-clickable-us-map v0.0.8
NgxClickableUsMap
This library was generated with Angular CLI version 14.0.0.
How to use
- Npm install package.
- Insert NgxClickableUsMapModule into the Imports in AppModule
Use
<lib-ngx-clickable-us-map></lib-ngx-clickable-us-map>
in the template to see the map.Each state has an ID with it's own two letter abbreviation. Ex: Colorado: id = 'CO'
- To set selections, pass in an array of strings to the @Input of
[selectedIds]
Selections are emitted via the @Output EventEmitter
(updatedSelections)
as an array of string IDs.The fill and unfill color of the map can be changed by using the @Input
[colors]
.colors = { unfill: #e2e2e2, fill: #0BCBA3 }
State Id List
statelist = {
AL: 'Alabama',
AK: 'Alaska'
AR: 'Arkansas',
AZ: 'Arizona',
CA: 'California',
CO: 'Colorado',
CT: 'Connecticut',
DC: 'District of Columbia',
DE: 'Delaware',
FL: 'Florida',
GA: 'Georgia',
HI: 'Hawaii',
IA: 'Iowa',
ID: 'Idaho',
IL: 'Illinois',
IN: 'Indiana',
KS: 'Kansas',
KY: 'Kentucky',
LA: 'Louisiana',
MA: 'Massachusetts',
MD: 'Maryland',
ME: 'Maine',
MI: 'Michigan',
MN: 'Minnesota',
MO: 'Missouri',
MS: 'Mississippi',
MT: 'Montana',
NC: 'North Carolina',
ND: 'North Dakota',
NE: 'Nebraska',
NH: 'New Hampshire',
NJ: 'New Jersey',
NM: 'New Mexico',
NV: 'Nevada',
NY: 'New York',
OH: 'Ohio',
OK: 'Oklahoma',
OR: 'Oregon',
PA: 'Pennsylvania',
RI: 'Rhode Island',
SC: 'South Carolina',
SD: 'South Dakota',
TN: 'Tennessee',
TX: 'Texas',
UT: 'Utah',
VA: 'Virginia',
VT: 'Vermont',
WA: 'Washington',
WI: 'Wisconsin',
WV: 'West Virginia',
WY: 'Wyoming',
};
Code scaffolding
Run ng generate component component-name --project ngx-clickable-us-map
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-clickable-us-map
.
Note: Don't forget to add
--project ngx-clickable-us-map
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build ngx-clickable-us-map
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build ngx-clickable-us-map
, go to the dist folder cd dist/ngx-clickable-us-map
and run npm publish
.
Running unit tests
Run ng test ngx-clickable-us-map
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.