MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / isMatchAdministrativeName

Function isMatchAdministrativeName

src/common/mapping/utils/util.js:53–63  ·  view source on GitHub ↗
(featureName, fieldName)

Source from the content-addressed store, hash-verified

51}
52
53export function isMatchAdministrativeName(featureName, fieldName) {
54 if (isString(fieldName)) {
55 let shortName = featureName.substr(0, 2);
56 // 张家口市和张家界市 特殊处理
57 if (shortName === '张家') {
58 shortName = featureName.substr(0, 3);
59 }
60 return !!fieldName.match(new RegExp(shortName));
61 }
62 return false;
63}
64
65export function transformServerUrl(serverUrl) {
66 return !serverUrl || serverUrl.slice(-1) === '/' ? serverUrl : `${serverUrl}/`;

Callers 2

createLinesDataFunction · 0.85

Calls 2

isStringFunction · 0.90
matchMethod · 0.80

Tested by

no test coverage detected