forked from MapComplete/MapComplete
		
	Fix country detection, fix phone number formatting, close #103
This commit is contained in:
		
							parent
							
								
									48ca24261f
								
							
						
					
					
						commit
						cba72ea915
					
				
					 3 changed files with 14 additions and 9 deletions
				
			
		|  | @ -110,14 +110,17 @@ export class FilteredLayer { | |||
|              | ||||
|             if (this.filters.matches(tags)) { | ||||
|                 const centerPoint = GeoOperations.centerpoint(feature); | ||||
|                 feature.properties["_surface"] = ""+GeoOperations.surfaceAreaInSqMeters(feature); | ||||
|                 const lat = ""+centerPoint.geometry.coordinates[1]; | ||||
|                 const lon = ""+centerPoint.geometry.coordinates[0] | ||||
|                 feature.properties["_lon"] = lat; | ||||
|                 feature.properties["_lat"] = lon; | ||||
|                 feature.properties["_surface"] = "" + GeoOperations.surfaceAreaInSqMeters(feature); | ||||
|                 const lat = centerPoint.geometry.coordinates[1]; | ||||
|                 const lon = centerPoint.geometry.coordinates[0] | ||||
|                 feature.properties["_lon"] = "" + lat; // We expect a string here for lat/lon
 | ||||
|                 feature.properties["_lat"] = "" + lon; | ||||
|                 // But the codegrid SHOULD be a number!
 | ||||
|                 FilteredLayer.grid.getCode(lat, lon, (error, code) => { | ||||
|                     if (error === null) { | ||||
|                         feature.properties["_country"] = code; | ||||
|                     } else { | ||||
|                         console.warn("Could not determine country for", feature.properties.id, error); | ||||
|                     } | ||||
|                 }) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue