forked from MapComplete/MapComplete
		
	Expose geometry type as metatag
This commit is contained in:
		
							parent
							
								
									62c34451fd
								
							
						
					
					
						commit
						5e03a06bf7
					
				
					 2 changed files with 20 additions and 21 deletions
				
			
		|  | @ -7,7 +7,6 @@ import Title from "../UI/Base/Title"; | |||
| import {FixedUiElement} from "../UI/Base/FixedUiElement"; | ||||
| import LayerConfig from "../Models/ThemeConfig/LayerConfig"; | ||||
| import {CountryCoder} from "latlon2country" | ||||
| import ScriptUtils from "../scripts/ScriptUtils"; | ||||
| 
 | ||||
| 
 | ||||
| export class SimpleMetaTagger  { | ||||
|  | @ -409,7 +408,21 @@ export default class SimpleMetaTaggers { | |||
|             feature.properties["_loaded:datetime"] = datetime(freshness); | ||||
|             return true; | ||||
|         } | ||||
|     ); | ||||
|      | ||||
|     public static geometryType = new SimpleMetaTagger( | ||||
|         { | ||||
|             keys:["_geometry:type"], | ||||
|             doc: "Adds the geometry type as property. This is identical to the GoeJson geometry type and is one of `Point`,`LineString`, `Polygon` and exceptionally `MultiPolygon` or `MultiLineString`", | ||||
|         }, | ||||
|         (feature, _) => { | ||||
|             const changed = feature.properties["_geometry:type"] === feature.geometry.type; | ||||
|             feature.properties["_geometry:type"] = feature.geometry.type; | ||||
|             return changed | ||||
|         } | ||||
|     ) | ||||
|      | ||||
|      | ||||
|     public static metatags: SimpleMetaTagger[] = [ | ||||
|         SimpleMetaTaggers.latlon, | ||||
|         SimpleMetaTaggers.layerInfo, | ||||
|  | @ -421,7 +434,8 @@ export default class SimpleMetaTaggers { | |||
|         SimpleMetaTaggers.directionSimplified, | ||||
|         SimpleMetaTaggers.currentTime, | ||||
|         SimpleMetaTaggers.objectMetaInfo, | ||||
|         SimpleMetaTaggers.noBothButLeftRight | ||||
|         SimpleMetaTaggers.noBothButLeftRight, | ||||
|         SimpleMetaTaggers.geometryType | ||||
| 
 | ||||
|     ]; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue