API / geotoolkit / attributes / PatternFactory / PatternFactory
attributes.PatternFactory.PatternFactory
Service to provide reusable patterns
Constructors
Methods
Methods
▸ addAlias(base, alias, category?): void
Adds pattern alias to a specific or default category
| Name | Type | Description |
|---|---|---|
base | string | original pattern name |
alias | string | string[] | name(s) of the original name |
Optional category | string | category name |
void
▸ addPattern(src, options): Pattern
Adds a new pattern with the specified options and registers it on factory. Requires pattern name note: if the pattern already exist it will override it.
| Name | Type | Description |
|---|---|---|
src | string | HTMLImageElement | Group<Node> | image src |
options | string | AddPatternOptions | pattern options or pattern name. |
▸ clear(): void
Remove all patterns and categories
void
▸ clearAliases(category?): void
Removes all or specified category aliases
| Name | Type | Description |
|---|---|---|
Optional category | string | category name |
void
▸ createPattern(src, options?): Pattern
Simply creates pattern by source without registering at factory
| Name | Type | Description |
|---|---|---|
src | string | HTMLImageElement | Pattern | Group<Node> | image src |
Optional options | CreatePatternOptions | pattern object, image url, image from DOM element or the image patterns options |
▸ getCategories(): string[]
return an array with all the categories
string[]
▸ getLoadTimeout(): number
Gets pattern load timeout
number
number
▸ getNames(category?): string[]
Return the list of pattern names contained in all or specific category
| Name | Type | Description |
|---|---|---|
Optional category | string | category name |
string[]
pattern names
▸ getPattern(name, category?): Pattern
Returns the pattern of specific category and name. Creates a new one if it doesn't exist
| Name | Type | Description |
|---|---|---|
name | string | pattern name |
Optional category | string | category name |
▸ getPatterns(category?): Pattern[]
Returns all image patterns contained in all or specific category
| Name | Type | Description |
|---|---|---|
Optional category | string | category name |
Pattern[]
The patterns
▸ removeAlias(alias, category?): void
Removes a pattern alias from specific or default category
| Name | Type | Description |
|---|---|---|
alias | string | name |
Optional category | string | category name |
void
▸ removeCategory(name): void
Removes a category
| Name | Type | Description |
|---|---|---|
name | string | name of the Pattern |
void
▸ removePattern(name, category?): void
Removes a pattern from this service
| Name | Type | Description |
|---|---|---|
name | string | pattern name |
Optional category | string | category name |
void
▸ setLoadTimeout(timeout): PatternFactory
Sets pattern load timeout
| Name | Type |
|---|---|
timeout | number |
this
▸ Static getDefaultContainerName(): string
Returns default container name
string
default container name
▸ Static getInstance(): PatternFactory
Returns instance of the registry
pattern factory
▸ Static setDefaultContainerName(name): PatternFactory
Set Default container name
| Name | Type | Description |
|---|---|---|
name | string | default container name |