13.12. Sass Map function

发布时间 :2024-02-29 23:00:06 UTC      

Sass Map (mapping) objects are one or more pairs key/value to show.

Sass Map is immutable, so it is processing Map object, a new Map object, not in the original Map object to make changes.

The following table lists the Sass’s Map function:

Function

Description & example

map-get(map, key)

Returns the value corresponding to key in Map. If there is no corresponding key, the null value is returned.

Example: $font-sizes: (“small”: 12px, “normal”: 18px, “large”: 24px) map-get ($font-sizes, “small”) result: 12px

map-has-key(map, key)

Determine whether map has a corresponding key. Return true if it exists, otherwise return false.

Example: $font-sizes: (“small”: 12px, “normal”: 18px, “large”: 24px) map-has-key ($font-sizes, “big”) result: false

map-keys(map)

Returns a queue of all the key in the map.

Example: $font-sizes: (“small”: 12px, “normal”: 18px, “large”: 24px) map-keys ($font-sizes) result: “small”, “normal,”large”

map-merge(map1, map2)

Merge two map to form a new map type, that is, add map2 to the tail of map1

Example: $font-sizes: (“small”: 12px, “normal”: 18px, “large”: 24px) $font-sizes2: (“x-large”: 30px, “xx-large”: 36px) map-merge ($font-sizes, $font-sizes2) result: “small”: 12px, “normal”: 18px, “large”: 24px, “x-large”: 30px, “xx-large”: 36px

map-remove(map, keys...)

Remove keys from map, and multiple key are separated by commas.

Example: $font-sizes: (“small”: 12px, “normal”: 18px, “large”: 24px) map-remove ($font-sizes, “small”) result: (“normal”: 18px, “large”: 24px) map-remove ($font-sizes, “small”, “large”) result: (“normal”: 18px)

map-values(map)

Returns all the value in map and generates a queue.

Example: $font-sizes: (“small”: 12px, “normal”: 18px, “large”: 24px) map-values ($font-sizes) result: 12px, 18px, 24px

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.