new cercalia.Util()
Methods
-
cercalia.Util.areaMetricToImperial(area){string}
src/cercalia/util.js, line 423 -
Name Type Description areanumber Area in ha
Returns:
Area in acrees.
-
cercalia.Util.convertDmsToDecimal(input){string}
src/cercalia/util.js, line 556 -
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
-
cercalia.Util.convertLatLngToDms(position){string}
src/cercalia/util.js, line 546 -
Convert degrees minutes seconds to decimal format.
Name Type Description positioncercalia.LonLat Output string. Format examples:
40° 03' 49.3" N, 3° 24' 42.2" W,40°03'49"N 3°24'42" WReturns:
Output string. Format examples:40° 03' 49.3" N, 3° 24' 42.2" W,40°03'49"N 3°24'42" W
-
cercalia.Util.createCircleGeometry(center, radius, opt_isPolygon){ol.geom.Polygon|ol.geom.Circle}
src/cercalia/util.js, line 514 -
Name Type Description centercercalia.LonLat Center.
radiusnumber Radius in meters.
isPolygonboolean If
true, it creates a circular polygonol.geom.Polygon, else creates a Circleol.geom.Circle. Defaultfalse.Returns:
Obtains Circle geometry or Circular polygon geometry.
-
cercalia.Util.distanceMetricToImperial(distance){string}
src/cercalia/util.js, line 406 -
Name Type Description distancenumber Distance in meters.
Returns:
distanceImp Distance imperial format string.
-
cercalia.Util.distanceMetricToNauticMiles(distance){string}
src/cercalia/util.js, line 433 -
Name Type Description distancenumber Distance in meters
Returns:
Nautic miles
-
cercalia.Util.distanceTo(coordA, coordB){number}
src/cercalia/util.js, line 256 -
Calculation distance between two coordinates.
Name Type Description coordAcercalia.LonLat Coordinate 1,
coordBcercalia.LonLat Coordinate 2.
Returns:
distance between two coordinates.
-
cercalia.Util.downloadKmlFromWkt(wkt, otp_filename)
src/cercalia/util.js, line 384 -
SaveW route as KML.
Name Type Description wktstring WKT.
otp_filenamestring Filename.
-
cercalia.Util.downloadXmlToFile(strXML, filename)
src/cercalia/util.js, line 442 -
Name Type Description strXMLstring XML in string format
filenamestring Filename to dowonload.
-
cercalia.Util.geofencing(polygon, lonLat){boolean}
src/cercalia/util.js, line 154 -
Returns
trueif the coordinate is inside polygon. Polygon must be in WKT format.Name Type Description polygonstring WKT String de un poligono
lonLatcercalia.LonLat Punto
Returns:
Returntrueif position is inside polygon.
-
cercalia.Util.geometryToWKT(geometry, projectionCode){string}
src/cercalia/util.js, line 88 -
Transfrom geometry to WKT
EPSG:4326.Name Type Description geometryol.geom.Geometry Object geometry
ol.Geometry.projectionCodestring Projection code
Returns:
WKT
-
Obtains circle radius and circle center. {center:
cercalia.LonLat, radius:number}Name Type Description featurecercalia.Feature Feature.
Returns:
data Circle data
-
cercalia.Util.getClosestFeatureByPosition(position, features){cercalia.Feature}
src/cercalia/util.js, line 234 -
Funcion para obtener de una lista de features
cercalia.Featurela feature mas cercana respecto a unacercalia.LonLat.Name Type Description positioncercalia.LonLat Position
featuresFeatures
Returns:
Feature
-
cercalia.Util.getClosestLonLatOfFeature(position, feature){cercalia.LonLat}
src/cercalia/util.js, line 217 -
Funcionn para obtener la coordenada mas cercana de
cercalia.Featurerespectocercalia.LonLat. Puede ser una feature del tipoPoint,LineString,Polygon.Name Type Description positioncercalia.LonLat Position
featurecercalia.Feature Feature
Returns:
Coordinate of closest feature.
-
cercalia.Util.getDistanceFromFeature(position, feature){number}
src/cercalia/util.js, line 199 -
Obtiene la distancia en metro de una
cercalia.LonLatrespecto el punto más cercano decercalia.Feature. Puede ser una feature del tipoPoint,LineString,Polygon.Name Type Description positioncercalia.LonLat Coordenada de referencia
featurecercalia.Feature Feature. No hace falta que esté pintada en el mapa para hacer este cálculo.
Returns:
Distancia en metros
-
cercalia.Util.getHexFromRgb(rgb){string}
src/cercalia/util.js, line 45 -
Convert hexadecimal to RGB color
Name Type Description rgbstring Rgb Color
Returns:
rgba color.
-
cercalia.Util.getPartialLinestring(feature, startfraction, endfraction){string|null}
src/cercalia/util.js, line 599 -
It obtains a partial line in WKT format specifying minimum and maximum percentages in base 1.
Name Type Description featurecercalia.Feature | ol.Feature Feature
startfractionnumber Min fraction
[0..1]endfractionnumber Max fraction
[0..1]Returns:
WKT
-
cercalia.Util.getProximityFormattedAddress(data){string}
src/cercalia/util.js, line 464 -
Get formatted adrress from proximity server data response.
Name Type Description dataProximity result
Name Type Description cercaliacercaliax.ProximityResultData Required.
Returns:
Formatted address.
-
cercalia.Util.splitWktGeomCollection(wktGeomCollection){Array.<string>|null}
src/cercalia/util.js, line 313 -
Name Type Description wktGeomCollectionstring wkt WKT of geomCollection
Returns:
array of WKT in geomcollection
-
cercalia.Util.transformColor2rgba(hexcolor, opacity){string|null}
src/cercalia/util.js, line 32 -
Convert color and opacity to RGBA format.
Name Type Description hexcolorstring Color in hexadecimal. P.e:
#ff0001opacitynumber Opacity. Decimal value
0to1.Returns:
color p.e:rgba(0, 0, 255, 0.1)
-
cercalia.Util.transformFeatureToKML(feature, opt_srs){string}
src/cercalia/util.js, line 364 -
Name Type Description featurecercalia.Feature Feature
srsstring SRS system. Default:
cercalia.proj.EPSG4326.Returns:
KML object.
-
cercalia.Util.transformWKT(wkt, projectionSrc, projectionDst){string}
src/cercalia/util.js, line 116 -
Transform WKT string to another projection.
Name Type Description wktstring WKT http://es.wikipedia.org/wiki/Well_Known_Text
projectionSrcstring Projection WKT origin
projectionDststring Projection WKT destination
Returns:
Geometry in WKT format transformed.
-
cercalia.Util.transformWktToKML(wkt, opt_srs){string}
src/cercalia/util.js, line 343 -
Name Type Description wktstring Geometry in WKT format.
srsstring SRS system. Default:
cercalia.proj.EPSG4326.Returns:
KML object.
-
Name Type Description wktstring WKT http://es.wikipedia.org/wiki/Well_Known_Text
Returns:
Geometry OL3ol.geom.Geometry