Methods
-
Convert area
metrictoimperial.Name Type Description areanumber Area in ha
Returns:
Area in acrees.
-
Name Type Description featuremodule:maplibre-gl~GeoJSONFeature Polygon geojson feature
Returns:
Returntrueif a polygon feature has intersections
-
Convert degrees minutes seconds to decimal format.
Name Type Description inputstring Input string. Format examples:
40° 03' 49.3" N, 3° 24' 42.2" W,40°03'49"N 3°24'42" WReturns:
Decimal format. Example41.431,2.41431
-
module:cercaliagl/util.createCircleGeometry(center, radius, vertices){module:cercaliagl/util~Polygon}
-
Create circle geometry given a
center, a radius and optionally number ofvertices.Name Type Description centermodule:cercaliagl/LonLat~LonLat Center.
radiusnumber Radius in meters
verticesnumber Number of vertices. Default
64.Returns:
geometry
-
Name Type Description elementHTMLElement HTML element to use as the marker
positionmodule:cercaliagl/LonLat~LonLat The position where to place the marker
Returns:
The created maplibre-gl marker
-
Name Type Description coordAArray.<number> Position 1
coordBArray.<number> Position 2
Returns:
Distance
-
Convert distance
metrictoimperial.Name Type Description distancenumber Distance in meters.
Returns:
distanceImp Distance imperial format string.
-
Calculation distance between two coordinates.
Name Type Description coordAmodule:cercaliagl/LonLat~LonLat Coordinate 1,
coordBmodule:cercaliagl/LonLat~LonLat Coordinate 2.
Returns:
distance between two coordinates.
-
SaveW route as KML.
Name Type Description wktstring WKT.
filenamestring Filename.
-
Download XML file passing a XML string.
Name Type Description strXMLstring XML in string format
filenamestring Filename to download.
-
Returns
trueif the coordinate is inside polygon. Polygon must be in WKT format.Name Type Description polygonstring Polygon WKT string
lonLatmodule:cercaliagl/LonLat~LonLat Coordinate
Returns:
Returntrueif position is inside polygon.
-
Transform GeoJSON format to WKT.
Name Type Description geojsonObject GeoJSON - https://geojson.org/
Returns:
WKT - http://es.wikipedia.org/wiki/Well_Known_Text
-
Returns:
Anchor equivalent
-
module:cercaliagl/util.getClosestFeatureByPosition(position){module:cercaliagl/Feature~Feature}
-
Get closest feature by a position given a position and a list of features.
Name Type Description positionmodule:cercaliagl/LonLat~LonLat Position * @param {Array.module:cercaliagl/Feature~Feature} features Features
Returns:
Feature,
-
module:cercaliagl/util.getClosestLonLatOfFeature(position, feature){module:cercaliagl/LonLat~LonLat}
-
Get closest position of a feature given a coordinate (position)
Name Type Description positionmodule:cercaliagl/LonLat~LonLat Position
featuremodule:cercaliagl/Feature~Feature Feature
Returns:
Coordinate of closest feature
-
Find intersections between a polygon and a linestring
Name Type Description polygonFeaturemodule:cercaliagl/Feature~Feature Polygon geojson feature 1
lineFeaturemodule:cercaliagl/Feature~Feature Linestring geojson feature 2
Returns:
Return line segments inside polygon
-
It obtains a partial line in WKT format specifying minimum and maximum percentages in base 1.
Name Type Description featuremodule:cercaliagl/Feature~Feature Feature
startfractionnumber Min fraction
[0..1]endfractionnumber Max fraction
[0..1]Returns:
WKT
-
Get formatted adrress from proximity server data response.
Name Type Description dataProximity result
Name Type Description cercaliamodule:cercaliagl/servers~ProximityResultData Returns:
Formatted address.
-
Remove HTML tags from a string.
Name Type Description strstring String with HTML
Returns:
String without HTML tags
-
Convert degrees to radiants.
Name Type Description anglenumber Angle in degrees
Returns:
Angle in radiants.
-
Transform WKT string to another projection.
Name Type Description wktstring projectionSrcstring Projection WKT origin
projectionDststring Projection WKT destination
Returns:
Geometry in WKT format transformed.
-
Transform WKT to KML format (https://developers.google.com/kml/documentation/kmlreference).
Name Type Description wktstring Geometry in WKT format.
Returns:
KML object.
-
Transform linestring to polygon adding a buffer.
Name Type Description wktstring radiusnumber Radius. Default
10. -
WKT to Geometry.
Name Type Description wktstring Returns:
GeoJSON - https://geojson.org/
Type Definitions
-
LineFeature{Object}
-
Properties:
Name Type Description type'Feature' Must be 'Feature'
propertiesObject Any properties
geometrymodule:cercaliagl/util~LineString | module:cercaliagl/util~MultiLineString The geometry object
-
LineString{Object}
-
Properties:
Name Type Description type'LineString' Must be 'LineString'
coordinatesArray.<Array.<number>> The coordinates array
-
MultiLineString{Object}
-
Properties:
Name Type Description type'MultiLineString' Must be 'MultiLineString'
coordinatesArray.<Array.<Array.<number>>> The coordinates array
-
MultiPolygon{Object}
-
Properties:
Name Type Description type'MultiPolygon' Must be 'MultiPolygon'
coordinatesArray.<Array.<Array.<Array.<number>>>> The coordinates array
-
Point{Object}
-
Properties:
Name Type Description type'Point' Must be 'Point'
coordinatesArray.<number> The coordinates array [longitude, latitude]
-
Polygon{Object}
-
Properties:
Name Type Description type'Polygon' Must be 'Polygon'
coordinatesArray.<Array.<Array.<number>>> The coordinates array
-
PolygonFeature{Object}
-
Properties:
Name Type Description type'Feature' Must be 'Feature'
propertiesObject Any properties
geometrymodule:cercaliagl/util~Polygon | module:cercaliagl/util~MultiPolygon The geometry object