CartoType Android API 7.8.2, 2022-03-25
for Java development on Android
|
Public Member Functions | |
Framework (Context aContext, String aMapFileName, String aStyleSheetFileName, String aFontFileName, int aViewWidth, int aViewHeight) | |
Framework (Context aContext, String aMapFileName, byte[] aMapEncryptionKey, String aStyleSheetFileName, String aFontFileName, int aViewWidth, int aViewHeight) | |
Framework (Context aContext, FrameworkParam aParam) | |
native int | license (String aKey) |
native String | licensee () |
native String | expiryDate () |
String | appBuildDate () |
native String | copyright () |
void | setCopyrightNotice () |
void | setCopyrightNotice (String aCopyright) |
void | setLegend (Legend aLegend, double aWidth, String aUnit, ExtendedNoticePosition aPosition) |
void | setLegend (Legend aLegend, double aWidth, String aUnit, NoticePosition aPosition) |
native void | enableLegend (boolean aEnable) |
void | setScaleBar (boolean aMetricUnits, double aWidth, String aUnit, ExtendedNoticePosition aPosition) |
void | setScaleBar (boolean aMetricUnits, double aWidth, String aUnit, NoticePosition aPosition) |
native void | enableScaleBar (boolean aEnable) |
int | setTurnInstructions (boolean aMetricUnits, boolean aAbbreviate, double aWidth, String aWidthUnit, ExtendedNoticePosition aPosition, double aTextSize, String aTextSizeUnit) |
int | setTurnInstructions (boolean aMetricUnits, boolean aAbbreviate, double aWidth, String aWidthUnit, NoticePosition aPosition, double aTextSize, String aTextSizeUnit) |
native void | enableTurnInstructions (boolean aEnable) |
native void | setTurnInstructionText (String aText) |
native String | turnInstructionText () |
native void | drawNoticesAutomatically (boolean aEnable) |
native boolean | hasNotices () |
int | loadMap (String aMapFileName) |
native int | loadMap (String aMapFileName, byte[] aMapEncryptionKey) |
native boolean | setMapsOverlap (boolean aEnable) |
int | createWritableMap (WritableMapType aType) |
int | saveMap (int aHandle, String aFileName, FileType aFileType) |
int | readMap (int aHandle, String aFileName, FileType aFileType) |
byte[] | saveMap (int aHandle, FindParam aFindParam) |
int | readMap (int aHandle, byte[] aData) |
int | writeMapImage (String aFileName, FileType aFileType, boolean aCompress) |
native boolean | mapIsEmpty (int aHandle) |
native int | mapCount () |
native MapMetaData | getMapMetaData (int aIndex) |
native int | unloadMap (int aHandle) |
native void | enableMap (int aHandle, boolean aEnable) |
native int | getLastMapHandle () |
native int | getMainMapHandle () |
native int | getMemoryMapHandle () |
native int | loadFont (String aFontFileName) |
int | setStyleSheet (String aStyleSheetFileName, int aIndex) |
int | setStyleSheet (byte[] aData, int aIndex) |
native int | reloadStyleSheet (int aIndex) |
void | appendStyleSheet (String aStyleSheetFileName) |
void | appendStyleSheet (byte[] aData) |
native int | deleteStyleSheet (int aIndex) |
int | resize (int aViewWidth, int aViewHeight) |
native String[] | layerNames () |
native void | enableLayer (String aLayerName, boolean aEnable) |
native void | setResolutionDpi (int aDpi) |
native double | resolutionDpi () |
native int | setScale (int aScale) |
native int | getScale () |
native int | configure (String aFileName) |
native int | setScaleDenominatorInView (int aScale) |
native int | getScaleDenominatorInView () |
double | getDistanceInMeters (double aX1, double aY1, double aX2, double aY2, CoordType aCoordType) |
Bitmap | getMap () |
Bitmap | getMemoryDataBaseMap () |
Bitmap | getTileBitmap (int aTileSizeInPixels, int aZoom, int aX, int aY) |
native boolean | clipBackgroundToMapBounds (boolean aEnable) |
native int | setTileOverSizeZoomLevels (int aLevels) |
native void | enableDrawingMemoryDataBase (boolean aEnable) |
native int | loadIcon (String aFileName, String aId, int aHotSpotX, int aHotSpotY, int aLabelX, int aLabelY, int aLabelMaxLength) |
native void | unloadIcon (String aId) |
native double | pixelsToMeters (double aPixels) |
native double | metersToPixels (double aMeters) |
native String | dataSetName () |
native int | editSetWritableMap (int aMapHandle) |
native int | editNewLineObject (double aX, double aY) |
native int | editNewPolygonObject (double aX, double aY) |
native int | editMoveCurrentPoint (double aX, double aY) |
native int | editAddCurrentPoint () |
native int | editDeleteCurrentPoint () |
native int | editDeleteCurrentObject () |
native int | editSelectNearestPoint (double aX, double aY, double aRadiusInMillimeters) |
native int | editInsertCurrentObject (String aLayer, long aId, boolean aReplace) |
native int | editSetCurrentObjectStringAttribute (String aKey, String aValue) |
native int | editSetCurrentObjectIntAttribute (int aValue) |
native double | editGetCurrentObjectArea () |
native double | editGetCurrentObjectLength () |
native void | setPerspective (boolean aEnable) |
void | setPerspective (PerspectiveParam aParam) |
native boolean | getPerspective () |
native PerspectiveParam | getPerspectiveParam () |
native boolean | setDraw3DBuildings (boolean aEnable) |
native boolean | getDraw3DBuildings () |
native boolean | setAnimateTransitions (boolean aEnable) |
native boolean | getAnimateTransitions () |
native int | zoom (double aZoomFactor) |
int | zoomAt (double aZoomFactor, double aX, double aY, CoordType aCoordType) |
int | zoomIn () |
int | zoomOut () |
native int | rotate (double aAngle) |
int | rotateAt (double aAngle, double aX, double aY, CoordType aCoordType) |
native int | setRotation (double aAngle) |
int | setRotationAt (double aAngle, double aX, double aY, CoordType aCoordType) |
native double | getRotation () |
native void | pan (int aDx, int aDy) |
void | panFromTo (double aFromX, double aFromY, CoordType aFromCoordType, double aToX, double aToY, CoordType aToCoordType) |
native int | setViewCenterLatLong (double aLong, double aLat) |
int | setView (double aX1, double aY1, double aX2, double aY2, CoordType aCoordType, int aMarginInPixels, int aMinScaleDenominator) |
void | setView (MapObject aMapObject, int aMarginInPixels, int aMinScaleDenominator) |
int | setView (MapObject[] aMapObjectArray, int aMarginInPixels, int aMinScaleDenominator) |
int | setView (Geometry aGeometry, int aMarginInPixels, int aMinScaleDenominator) |
int | setView (ViewState aViewState) |
native ViewState | getViewState () |
native int | setViewToRoute (int aRouteIndex, int aMarginInPixels, int aMinScaleDenominator) |
native int | setViewToWholeMap () |
native int | setViewLimits (double aMinScaleDenominator, double aMaxScaleDenominator, Geometry aPanArea) |
void | getViewDimensions (double[] aPoint, CoordType aCoordType) |
void | getMapExtent (double[] aPoint, CoordType aCoordType) |
native String | getProjectionAsProj4Param () |
long | getLastObjectId () |
native int | insertMapObject (int aMapHandle, String aLayerName, Geometry aGeometry, String aStringAttributes, int aIntAttribute, long aId, boolean aReplace) |
int | insertPointMapObject (int aMapHandle, String aLayerName, double aX, double aY, CoordType aCoordType, String aStringAttributes, int aIntAttribute, long aId, boolean aReplace) |
int | insertCircleMapObject (int aMapHandle, String aLayerName, double aCenterX, double aCenterY, CoordType aCenterCoordType, double aRadius, CoordType aRadiusCoordType, String aStringAttributes, int aIntAttribute, long aId, boolean aReplace) |
int | insertEnvelopeMapObject (int aMapHandle, String aLayerName, Geometry aGeometry, double aRadius, CoordType aRadiusCoordType, String aStringAttributes, int aIntAttribute, long aId, boolean aReplace) |
int | insertPushPin (double aX, double aY, CoordType aCoordType, String aStringAttributes, String aColor, int aIconCharacter, long aId) |
int | insertCopyOfMapObject (int aMapHandle, String aLayername, MapObject aMapObject, double aEnvelopeRadius, CoordType aRadiusCoordType, long aId, boolean aReplace) |
native long | deleteMapObjects (int aMapHandle, long aStartId, long aEndId, String aCondition) |
native MapObject | loadMapObject (int aMapHandle, long aObjectId) |
native int | readGpx (int aMapHandle, String aFileName) |
Geometry | range (RouteProfile aProfile, double aX, double aY, CoordType aCoordType, double aTimeOrDistance, boolean aIsTime) |
TimeAndDistanceMatrix | timeAndDistanceMatrix (double[] aFrom, double[] aTo, CoordType aCoordType) |
RouteAccess | routeAccess (double aX, double aY, CoordType aCoordType) |
int | convertCoords (Geometry aGeometry, CoordType aToCoordType) |
double | getArea (Geometry aGeometry) |
double | getLengthOrPerimeter (Geometry aGeometry) |
double | getContourArea (Geometry aGeometry, int aContourIndex) |
double | getContourLengthOrPerimeter (Geometry aGeometry, int aContourIndex) |
native void | setStyleSheetVariable (String aVariableName, String aValue) |
void | setStyleSheetVariable (String aVariableName, int aValue) |
native boolean | setNightMode (boolean aSet) |
native int | setNightModeColor (int aColor) |
native boolean | getNightMode () |
native int | getNightModeColor () |
native BlendStyle[] | setBlendStyle (BlendStyle[] aBlendStyleSet) |
native BlendStyle[] | getBlendStyleSet () |
void | setPreferredRouterType (RouterType aRouterType) |
RouterType | preferredRouterType () |
RouterType | actualRouterType () |
int | startNavigation (double aStartX, double aStartY, CoordType aStartCoordType, double aEndX, double aEndY, CoordType aEndCoordType) |
int | startNavigation (double[] aX, double[] aY, CoordType aCoordType) |
int | startNavigation (RouteCoordSet aCoordSet) |
Route | createRoute (RouteProfile aProfile, RouteCoordSet aCoordSet) |
Route | createBestRoute (RouteProfile aProfile, RouteCoordSet aCoordSet, boolean aStartFixed, boolean aEndFixed, int aIterations) |
int | createRouteAsync (RouterAsyncInterface aHandler, RouteProfile aProfile, RouteCoordSet aCoordSet, boolean aOverride) |
int | createBestRouteAsync (RouterAsyncInterface aHandler, RouteProfile aProfile, RouteCoordSet aCoordSet, boolean aStartFixed, boolean aEndFixed, int aIterations, boolean aOverride) |
Route | createRouteFromXml (RouteProfile aProfile, String aFileNameOrData) |
native void | endNavigation () |
native boolean | enableNavigation (boolean aEnable) |
native boolean | navigationEnabled () |
native int | setMainProfile (RouteProfile aProfile) |
native RouteProfile | profile (int aIndex) |
native int | builtInProfileCount () |
native RouteProfile | builtInProfile (int aIndex) |
native int | setBuiltInProfile (int aIndex) |
native int | addProfile (RouteProfile aProfile) |
native int | chooseRoute (int aRouteIndex) |
native int | displayRoute (boolean aEnable) |
native int | getRouteCount () |
Route | getRoute (int aIndex) |
native int | readRouteFromXml (String aFileNameOrData, boolean aReplace) |
native int | useRoute (Route aRoute, boolean aReplace) |
native String | getRouteInstructions (Route aRoute) |
native int | reverseRoutes () |
native int | deleteRoutes () |
int | writeRouteAsXml (Route aRoute, String aFileName, FileType aFileType) |
String | writeRouteAsXmlString (Route aRoute, FileType aFileType) |
native int | loadNavigationData () |
native int | navigate (int aValidity, double aTime, double aLong, double aLat, double aSpeed, double aCourse, double aHeight) |
NavigationState | getNavigationState () |
native void | setNavigatorMinimumFixDistance (int aMeters) |
native void | setNavigatorTimeTolerance (int aSeconds) |
native void | setNavigatorDistanceTolerance (int aMeters) |
native void | setNavigatorAutoReRoute (boolean aAutoReRoute) |
native void | setNavigatorParam (NavigatorParam aNavigatorParam) |
native NavigatorParam | getNavigatorParam () |
native void | setLocationMatchParam (LocationMatchParam aParam) |
native LocationMatchParam | getLocationMatchParam () |
native int | setNearbyObjectWarning (int aId, String aLayer, String aCondition, double aMaxDistance, int aMaxObjectCount) |
native int | setVehicleTypeWarning (double aMaxDistance, int aMaxObjectCount) |
native boolean | deleteNearbyObjectWarning (int aId) |
native boolean | clearNearbyObjectWarnings () |
native MapObject[] | copyNearbyObjects () |
native double | distanceToDestination () |
native double | estimatedTimeToDestination () |
native double | getFirstTurn (Turn aTurn) |
native double | getSecondTurn (Turn aTurn) |
native double | getContinuationTurn (Turn aTurn) |
void | convertCoords (double[] aCoordArray, CoordType aFromCoordType, CoordType aToCoordType) |
native MapObject[] | findInDisplay (int aMaxObjectCount, double aX, double aY, double aRadius) |
native MapObject[] | findBuildingsNearStreet (MapObject aStreet) |
native MapObject[] | findAddress (int aMaxObjectCount, Address aAddress, boolean aFuzzy) |
native int | findAddressAsync (FindAsyncInterface aHandler, int aMaxObjectCount, Address aAddress, boolean aFuzzy, boolean aOverride) |
native MapObject[] | findStreetAddresses (int aMaxObjectCount, Address aAddress, Geometry aClip) |
MapObject[] | findAddressPart (int aMaxObjectCount, String aText, AddressPart aAddressPart, boolean aFuzzy, boolean aIncremental) |
MapObject[] | findInLayer (int aMaxObjectCount, String aLayer, double aX1, double aY1, double aX2, double aY2, CoordType aCoordType) |
MapObject[] | find (int aMaxObjectCount, String aText, int aMatchMethod) |
MapObject[] | findText (int aMaxObjectCount, String aText, int aMatchMethod, String aLayers, String aAttributes) |
MapObject[] | find (int aMaxObjectCount, Geometry aClip, String aLayers, String aAttributes, String aText, int aStringMatchMethod, String aCondition, boolean aMerge) |
native MapObject[] | find (FindParam aFindParam) |
native int | findAsync (FindAsyncInterface aHandler, FindParam aFindParam, boolean aOverride) |
native MapObjectGroup[] | findGroups (FindParam aFindParam) |
native int | findAsyncGroups (FindAsyncGroupInterface aHandler, FindParam aFindParam, boolean aOverride) |
MapObject[] | find (PointOfInterestType aType, String aText, Geometry aLocation) |
native MapObject[] | findPolygonsContainingPath (Geometry aPath, FindParam aFindParam) |
native MapObject[] | findPointsInPath (Geometry aPath, FindParam aFindParam) |
int | getHeight (double aX, double aY, CoordType aCoordType) |
int | getHeights (double[] aX, double[] aY, int[] aTerrainHeightArray, CoordType aCoordType) |
String | getGeoCodeSummary (double aX, double aY, CoordType aCoordType) |
int | getAddress (Address aAddress, double aX, double aY, CoordType aCoordType) |
int | findNearestRoad (NearestRoadInfo aInfo, double aX, double aY, CoordType aCoordType, double aHeadingInDegrees, boolean aDisplayPosition) |
native int | displayPositionOnNearestRoad (double aLong, double aLat, double aHeadingInDegrees, NearestRoadInfo aInfo) |
native void | setVehiclePosOffset (double aXOffset, double aYOffset) |
native void | setLocale (String aLocale) |
native String | locale () |
String | setCase (String aString, LetterCase aCase) |
native int | setFollowMode (int aFollowMode) |
native int | getFollowMode () |
int | getNavigationPosition (double[] aPoint, CoordType aCoordType) |
native int | addTrafficInfo (long aId, TrafficInfo aTrafficInfo, LocationRef aLocationRef) |
int | addPolygonSpeedLimit (long aId, Geometry aPolygon, double aSpeed, int aVehicleTypes) |
int | addLineSpeedLimit (long aId, Geometry aLine, double aSpeed, int aVehicleTypes) |
int | addClosedLineSpeedLimit (long aId, Geometry aLine, double aSpeed, int aVehicleTypes) |
int | addForbiddenArea (long aId, Geometry aPolygon) |
native int | deleteTrafficInfo (long aId) |
native void | clearTrafficInfo () |
native boolean | enableTrafficInfo (boolean aEnable) |
native void | startTracking () |
native void | endTracking () |
native void | deleteTrack () |
native boolean | tracking () |
native boolean | displayTrack (boolean aEnable) |
Geometry | getTrack () |
native double | trackLengthInMeters () |
native int | writeTrackAsXml (String aFileName) |
native String | writeTrackAsXmlString () |
void | onViewChange () |
void | onMainDataChange () |
void | onDynamicDataChange () |
Static Public Member Functions | |
static int | intAttribute (String aThreeLetterCode, int aType) |
static int | color (int aRed, int aGreen, int aBlue) |
static int | color (int aRed, int aGreen, int aBlue, int aAlpha) |
static int | setColorAlpha (int aColor, int aAlpha) |
static native int | color (String aColor) |
The Framework class owns and manages the CartoType engine and the maps, fonts and style sheets.
com.cartotype.Framework.Framework | ( | Context | aContext, |
String | aMapFileName, | ||
String | aStyleSheetFileName, | ||
String | aFontFileName, | ||
int | aViewWidth, | ||
int | aViewHeight | ||
) |
Creates a CartoType framework containing engine, map, style sheet and fonts.
com.cartotype.Framework.Framework | ( | Context | aContext, |
String | aMapFileName, | ||
byte[] | aMapEncryptionKey, | ||
String | aStyleSheetFileName, | ||
String | aFontFileName, | ||
int | aViewWidth, | ||
int | aViewHeight | ||
) |
Creates a CartoType framework containing engine, map, style sheet and fonts. If aMapEncryptionKey is non-null the map must have been encrypted using it.
com.cartotype.Framework.Framework | ( | Context | aContext, |
FrameworkParam | aParam | ||
) |
Creates a CartoType framework from parameters contained in a FrameworkParam object.
RouterType com.cartotype.Framework.actualRouterType | ( | ) |
If route data has been loaded for the current map or maps, returns the actual router type in use, which may not be the same as the preferred router type, because some router types are not available for certain types of data.
If the route data has not been loaded this function returns RouterType.Default. Route data is loaded when the first route is constructed.
int com.cartotype.Framework.addClosedLineSpeedLimit | ( | long | aId, |
Geometry | aLine, | ||
double | aSpeed, | ||
int | aVehicleTypes | ||
) |
Adds a speed limit in kph, to be used when calculating routes, to a polygon which is the interior of a closed line along roads, defined by a series of points.
Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). The ID can be used when calling DeleteTrafficInfo().
aLine is a series of points defining the polygon. The polygon is calculated as the best route through the points, using the route network, so to be certain of specifying the desired polygon you need to supply a point for every junction.
aSpeed is the speed to which travel is restricted in kph. Values of zero or less indicate that the road is closed. Values higher than 255 indicate that there is no speed limit.
aVehicleTypes is a set of flags drawn from the vehicle type constants defined in RouteProfile. If aVehicleTypes is 0, all vehicles are affected.
A polygon map object representing the speed limit is added to the layer 'traffic'.
See also addTrafficInfo(), addLineSpeedLimit(), addPolygonSpeedlimit(), addForbiddenArea(), deleteTrafficInfo(), and clearTrafficInfo().
int com.cartotype.Framework.addForbiddenArea | ( | long | aId, |
Geometry | aPolygon | ||
) |
Marks a certain polygon as forbidden for routing.
Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). The ID can be used when calling DeleteTrafficInfo().
See also addTrafficInfo(), addLineSpeedLimit(), addPolygonSpeedLimit(), deleteTrafficInfo() and clearTrafficInfo().
int com.cartotype.Framework.addLineSpeedLimit | ( | long | aId, |
Geometry | aLine, | ||
double | aSpeed, | ||
int | aVehicleTypes | ||
) |
Adds a speed limit in kph, to be used when calculating routes, to a route defined by a series of points.
Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). The ID can be used when calling DeleteTrafficInfo().
aLine is a series of points defining the road. The road is calculated as the best route through the points, using the route network, so to be certain of specifying the desired route you need to supply a point for every junction. The points are snapped to the nearest nodes in the route network. This means that at the moment you cannot set a speed limit for a range smaller than an arc between two nodes.
aSpeed is the speed to which travel is restricted in kph. Values of zero or less indicate that the road is closed. Values higher than 255 indicate that there is no speed limit.
aVehicleTypes is a set of flags drawn from the vehicle type constants defined in RouteProfile. If aVehicleTypes is 0, all vehicles are affected.
A line map object representing the speed limit is added to the layer 'traffic'.
See also addTrafficInfo(), addClosedLineSpeedLimit(), addPolygonSpeedlimit(), addForbiddenArea(), deleteTrafficInfo(), and clearTrafficInfo().
int com.cartotype.Framework.addPolygonSpeedLimit | ( | long | aId, |
Geometry | aPolygon, | ||
double | aSpeed, | ||
int | aVehicleTypes | ||
) |
Adds a speed limit in kph, to be used when calculating routes, to all roads in a certain polygon. To specify particular roads, or an area enclosed by roads, use AddTrafficInfo(). This allows the router to take account of slow-downs caused by traffic density, road works, etc.
Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). The ID can be used when calling DeleteTrafficInfo().
aSpeed is the speed to which travel is restricted, in kph. If aSpeed is zero or less, routing is forbidden in the given polygon.
aVehicleTypes is a set of flags drawn from the vehicle type constants defined in RouteProfile. If aVehicleTypes is 0, all vehicles are affected.
A polygon map object representing the speed limit is added to the layer 'traffic'.
See also addTrafficInfo(), addLineSpeedlimit(), addForbiddenArea(), deleteTrafficInfo(), and clearTrafficInfo().
native int com.cartotype.Framework.addProfile | ( | RouteProfile | aProfile | ) |
Adds a new routing profile. A Framework object starts with a single routing profile. Adding new profiles allows several different routes to be calculated for the same start and end point.
This function has no effect if routing is performed on a map with a built-in contraction-hierarchy routing table (created using makemap /route=ch), because such a table is created using a fixed routing profile which can be set in makemap.
Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.addTrafficInfo | ( | long | aId, |
TrafficInfo | aTrafficInfo, | ||
LocationRef | aLocationRef | ||
) |
Adds traffic information, such as a speed restriction, prohibition on the use of a route, reduction in the number of lanes, notification of road works, etc. At present only speed restrictions are supported.
This is the general function. See also the specialized functions addPolygonSpeedLimit(), addLineSpeedLimit(), addClosedLineSpeedLimit() and addForbiddenArea().
Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). The ID can be used when calling DeleteTrafficInfo().
aTrafficInfo gives the type of information (speed limit, etc.).
aLocationRef defines the location (area, road, point, etc.). Only the values ROAD_ORIENTATION_FORWARDS and ROAD_ORIENTATION_NONE (which means the same in this context) is supported for iRoadOrientation in aLocationRef.
String com.cartotype.Framework.appBuildDate | ( | ) |
Returns the date on which the application was built in the form YYYY-MM-DD.
void com.cartotype.Framework.appendStyleSheet | ( | byte[] | aData | ) |
Loads an extra style sheet from data in memory. Extra style sheets are compiled after the main style sheet.
void com.cartotype.Framework.appendStyleSheet | ( | String | aStyleSheetFileName | ) |
Loads an extra style sheet from a file. Extra style sheets are compiled after the main style sheet.
native RouteProfile com.cartotype.Framework.builtInProfile | ( | int | aIndex | ) |
Returns a built-in routing profile selected by its index, or null if the index is out of range. Routers allowing an arbitrary profile to be set have no built-in profiles. The contraction hierarchy router has one or more built-in profiles.
native int com.cartotype.Framework.builtInProfileCount | ( | ) |
Returns the number of built-in routing profiles owned by the router. This function returns zero for routers allowing an arbitrary profile to be set, and one or greater for the contraction hierarchy router, which stores one or more fixed profiles.
native int com.cartotype.Framework.chooseRoute | ( | int | aRouteIndex | ) |
Chooses one among a set of alternative routes. The index aRouteIndex selects the route: index 0 is the route created from the main profile. Indexes from 1 upwards select routes created using profiles added using addProfile(), in order of their addition.
Returns a CartoType error code: 0 = success.
This function is most appropriately called after calling startNavigation() to create the routes, but before calling navigate() to supply a position.
native boolean com.cartotype.Framework.clearNearbyObjectWarnings | ( | ) |
Clears all nearby object warnings, and the objects themselves, and returns true if any objects were deleted.
native void com.cartotype.Framework.clearTrafficInfo | ( | ) |
Deletes all speed restrictions, forbidden areas and other traffic information.
native boolean com.cartotype.Framework.clipBackgroundToMapBounds | ( | boolean | aEnable | ) |
Enables or disables clipping the map background to the map bounds. Use this when creating map tiles to be overlaid on a larger map, so that the background (sea) color does not erase the larger map's graphics. The return value is the previous state.
|
static |
Creates a color value from red, green, blue and alpha values in the range 0...255.
|
static |
Creates a color value from red, green, blue and alpha values in the range 0...255.
|
static |
Creates a color value from a string. For the format of the string see the documentation on CartoType style sheets.
native int com.cartotype.Framework.configure | ( | String | aFileName | ) |
Configures the CartoType framework by reading an XML configuration file.
void com.cartotype.Framework.convertCoords | ( | double[] | aCoordArray, |
CoordType | aFromCoordType, | ||
CoordType | aToCoordType | ||
) |
Converts any number of pairs of coordinates from one type to another. In each pair the first coordinate is the x or longitude value and the second is the y or latitude value. If the array size is odd the last value is ignored.
Converts the coordinates of aGeometry to a different coordinate type. Returns a CartoType result code: 0 = success.
native MapObject[] com.cartotype.Framework.copyNearbyObjects | ( | ) |
Returns copies of all the objects for which nearby object warnings exist.
native String com.cartotype.Framework.copyright | ( | ) |
Returns the copyright string stored in the main map database.
Route com.cartotype.Framework.createBestRoute | ( | RouteProfile | aProfile, |
RouteCoordSet | aCoordSet, | ||
boolean | aStartFixed, | ||
boolean | aEndFixed, | ||
int | aIterations | ||
) |
Creates an optimized route to visit a series of waypoints in any order. If aStartFixed is true, the first point in the route is always the first point supplied. If aEndFixed is true, the last point in the route is always the last point supplied. To create a circular route starting and ending at a predetermined place, but visiting the other points in any order, set aStartFixed and aEndFixed true, and make the first and last point the same. aIterations is the number of different routes to be tried.
int com.cartotype.Framework.createBestRouteAsync | ( | RouterAsyncInterface | aHandler, |
RouteProfile | aProfile, | ||
RouteCoordSet | aCoordSet, | ||
boolean | aStartFixed, | ||
boolean | aEndFixed, | ||
int | aIterations, | ||
boolean | aOverride | ||
) |
An asynchronous version of CreateBestRoute. Creates a route asynchronously and calls the handler() method of aHandler (from a different thread) with the created route and an error code.
If aOverride is true, any pending asynchronous routing operations that have not yet been started are deleted. Asynchronous routing operations are executed in order.
Returns an error code indicating whether the async operation was successfully scheduled (0 = success).
Route com.cartotype.Framework.createRoute | ( | RouteProfile | aProfile, |
RouteCoordSet | aCoordSet | ||
) |
Creates a route without starting navigation, supplying a route profile and waypoints.
int com.cartotype.Framework.createRouteAsync | ( | RouterAsyncInterface | aHandler, |
RouteProfile | aProfile, | ||
RouteCoordSet | aCoordSet, | ||
boolean | aOverride | ||
) |
Creates a route asynchronously and calls the handler() method of aHandler (from a different thread) with the created route and an error code.
If aOverride is true, any pending asynchronous routing operations that have not yet been started are deleted. Asynchronous routing operations are executed in order.
Returns an error code indicating whether the async operation was successfully scheduled (0 = success).
Route com.cartotype.Framework.createRouteFromXml | ( | RouteProfile | aProfile, |
String | aFileNameOrData | ||
) |
Creates a route by reading it from XML data in GPX or CartoType route format. If the parameter aFileNameOrData starts with a less-than sign, it is treated as XML data, otherwise it is treated as a filename.
If GPX data contains route elements, the first of them is used; otherwise the first track element is used if any.
The profile is ignored if the data is in CartoType route format, which contains the profile used to create it.
int com.cartotype.Framework.createWritableMap | ( | WritableMapType | aType | ) |
Creates a writable (editable) map of the specified type and loads it. Returns a CartoType result code: 0 = success.
native String com.cartotype.Framework.dataSetName | ( | ) |
Returns the name of the data in the main map database.
native long com.cartotype.Framework.deleteMapObjects | ( | int | aMapHandle, |
long | aStartId, | ||
long | aEndId, | ||
String | aCondition | ||
) |
Deletes map objects from the writable map identified by aMapHandle. Objects with IDs in the range aStartId...aEndId inclusive are deleted. If aCondition is non-null and non-empty, only objects fulfilling the condition, which is a style sheet expression, are deleted. Returns the number of objects deleted.
native boolean com.cartotype.Framework.deleteNearbyObjectWarning | ( | int | aId | ) |
Deletes the nearby object warning or vehicle type warning with an ID of aId and returns true if any such object existed.
native int com.cartotype.Framework.deleteRoutes | ( | ) |
Deletes all routes. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.deleteStyleSheet | ( | int | aIndex | ) |
Deletes the style sheet with the specified index. The main style sheet (index 0) may not be deleted. Other style sheets have indexes from 1 up, in the order of loading. Returns a CartoType error code: 0 = success.
native void com.cartotype.Framework.deleteTrack | ( | ) |
Deletes the current track. Does not affect whether tracking is on or off.
native int com.cartotype.Framework.deleteTrafficInfo | ( | long | aId | ) |
Deletes traffic information: a speed limit, forbidden area, or other information, referring to it by the ID returned when the restriction was added by addTrafficInfo(), addLineSpeedLimit(), addForbiddenArea(), etc.
Use clearTrafficInfo() to delete all restrictions and forbidden areas.
native int com.cartotype.Framework.displayPositionOnNearestRoad | ( | double | aLong, |
double | aLat, | ||
double | aHeadingInDegrees, | ||
NearestRoadInfo | aInfo | ||
) |
Moves the route position object and the route vector object to the nearest point on a road. Uses the supplied position and heading. If aHeadingInDegrees is not negative, uses it to choose among roads going in different directions. The current location match parameters are used. If aInfo is non-null, returns information about the nearest road. This function can be used whether or not navigation is being performed.
Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.displayRoute | ( | boolean | aEnable | ) |
If aEnable is true, displays the current route and a maximum of 2 alternative routes. If not, removes the current route from the display.
native boolean com.cartotype.Framework.displayTrack | ( | boolean | aEnable | ) |
Enables or disables displaying the track. Returns the previous state.
native double com.cartotype.Framework.distanceToDestination | ( | ) |
Returns the distance from the current point on the route to the destination in meters.
native void com.cartotype.Framework.drawNoticesAutomatically | ( | boolean | aEnable | ) |
Controls whether notices (the scale bar, legend and copyright notice) are drawn automatically.
native int com.cartotype.Framework.editAddCurrentPoint | ( | ) |
Adds a new point to the editable object by copying the current point. Returns an error code (0 = success).
native int com.cartotype.Framework.editDeleteCurrentObject | ( | ) |
Deletes the current editable object. Returns an error code (0 = success).
native int com.cartotype.Framework.editDeleteCurrentPoint | ( | ) |
Deletes the editable object's current point unless that would result in a line object of fewer than 2 points, or a polygon object of fewer than 3. Returns an error code (0 = success).
native double com.cartotype.Framework.editGetCurrentObjectArea | ( | ) |
Returns the area of the currently edited object. Returns 0 for line objects, or if there is no currently edited object.
native double com.cartotype.Framework.editGetCurrentObjectLength | ( | ) |
Returns the length or perimeter of the currently edited object. Returns 0 if there is no currently edited object.
native int com.cartotype.Framework.editInsertCurrentObject | ( | String | aLayer, |
long | aId, | ||
boolean | aReplace | ||
) |
Inserts the currently edited object into a chosen layer, converting it from an edited object into an ordinary object. If aId is non-zero and aReplace is true, replaces any existing object with that ID, otherwise creates a new object. The ID of the new object can be obtained using getLastObjectId(). Returns an error code (0 = success).
native int com.cartotype.Framework.editMoveCurrentPoint | ( | double | aX, |
double | aY | ||
) |
Moves the editable object's current point if any to a specified point in display coordinates. Returns an error code (0 = success).
native int com.cartotype.Framework.editNewLineObject | ( | double | aX, |
double | aY | ||
) |
Creates a new editable line object starting at the specified point in display coordinates. Returns an error code (0 = success).
native int com.cartotype.Framework.editNewPolygonObject | ( | double | aX, |
double | aY | ||
) |
Creates a new editable polygon object starting at the specified point in display coordinates. Returns an error code (0 = success).
native int com.cartotype.Framework.editSelectNearestPoint | ( | double | aX, |
double | aY, | ||
double | aRadiusInMillimeters | ||
) |
Selects an editable object by selecting the nearest point of any editable object within a given radius, in millimeters, of a point in display coordinates. If the point is not within the given radius of an existing point, creates a new point. Returns an error code (0 = success).
native int com.cartotype.Framework.editSetCurrentObjectIntAttribute | ( | int | aValue | ) |
Sets the integer attribute of the currently edited object.
native int com.cartotype.Framework.editSetCurrentObjectStringAttribute | ( | String | aKey, |
String | aValue | ||
) |
Sets a string attribute in the currently edited object. If aKey is empty, sets the label. If aValue is empty, deletes the attribute.
native int com.cartotype.Framework.editSetWritableMap | ( | int | aMapHandle | ) |
Sets the map used to store editable objects. Does not affect objects already created. If this function is not called, editable objects are stored in the map used for route objects. Returns an error code (0 = success).
native void com.cartotype.Framework.enableDrawingMemoryDataBase | ( | boolean | aEnable | ) |
Enables or disables the drawing of the in-memory database when the rest of the map is drawn. The in-memory database is used for the route, its start and end, and the current vehicle position. If drawing the in-memory database is disabled, you can get a separate image containing the objects from the in-memory database by calling getMemoryDataBaseMapBitmap.
native void com.cartotype.Framework.enableLayer | ( | String | aLayerName, |
boolean | aEnable | ||
) |
Enables or disables a named map layer.
native void com.cartotype.Framework.enableLegend | ( | boolean | aEnable | ) |
Enables or disables the drawing of a legend that has been supplied using SetLegend.
native void com.cartotype.Framework.enableMap | ( | int | aHandle, |
boolean | aEnable | ||
) |
Enables or disables a map, selecting it by handle.
native boolean com.cartotype.Framework.enableNavigation | ( | boolean | aEnable | ) |
Enables or disables navigation. When navigation is disabled, the follow modes work but no navigation is performed even if there is a route. The return value is the previous state.
native void com.cartotype.Framework.enableScaleBar | ( | boolean | aEnable | ) |
Enables or disables the drawing of a scale bar that has been supplied using SetScale.
native boolean com.cartotype.Framework.enableTrafficInfo | ( | boolean | aEnable | ) |
Enables or disables the use of traffic information when routing. Returns the previous state.
native void com.cartotype.Framework.enableTurnInstructions | ( | boolean | aEnable | ) |
Enables or disables the drawing of a turn instruction notice that has been supplied using setTurnInstructions.
native void com.cartotype.Framework.endNavigation | ( | ) |
Stops navigating. Current routes remain in existence. Navigation can be resumed using startNavigation or enableNavigation.
native void com.cartotype.Framework.endTracking | ( | ) |
Stops tracking (storing and displaying track points). Does not delete the current track.
native double com.cartotype.Framework.estimatedTimeToDestination | ( | ) |
Returns the estimated time from the current point on the route to the destination in seconds.
native String com.cartotype.Framework.expiryDate | ( | ) |
Returns the expiry date of the license in the form YYYY-MM-DD.
A general find function using a FindParam parameter object.
MapObject[] com.cartotype.Framework.find | ( | int | aMaxObjectCount, |
Geometry | aClip, | ||
String | aLayers, | ||
String | aAttributes, | ||
String | aText, | ||
int | aStringMatchMethod, | ||
String | aCondition, | ||
boolean | aMerge | ||
) |
A general find function, allowing any combination of parameters.
The objects returned are in map coordinates.
aClip, if non-null, restricts the search to objects intersecting a certain path.
aLayers, if non-null, is a list of layers separated by spaces or commas. If it is null all layers are searched.
aAttributes is used in text searching (if aText is non-null). If aAttributes is null or empty, search all attributes, otherwise aAttributes is a list of attributes separated by spaces or commas; use "$" to indicate the label (the unnamed attribute).
aText, if non-null, restricts the search to objects containing aText in one of their string attributes.
aStringMatchMethod is used in text searching.
aCondition, if non-null, is an expression using the same syntax as style sheet expressions (e.g., "Type==2") which must be fulfilled by all the objects.
aMerge, if true, merges adjoining objects with the same name and attributes into a single object.
MapObject[] com.cartotype.Framework.find | ( | int | aMaxObjectCount, |
String | aText, | ||
int | aMatchMethod | ||
) |
Finds map objects with attributes matching a certain string, searching all attributes and all layers.
MapObject[] com.cartotype.Framework.find | ( | PointOfInterestType | aType, |
String | aText, | ||
Geometry | aLocation | ||
) |
A find function to find nearby objects. You can also construct a FindParam object from the same parameters, modify them if needed, and call find() or findAsync().
native int com.cartotype.Framework.findAddressAsync | ( | FindAsyncInterface | aHandler, |
int | aMaxObjectCount, | ||
Address | aAddress, | ||
boolean | aFuzzy, | ||
boolean | aOverride | ||
) |
An asynchronous address finding function.
Calls the handler() method of aHandler (from a different thread) with the map objects that have been found when the operation has been completed.
If aOverride is true, any pending asynchronous find operations that have not yet been started are deleted. Asynchronous find operations are executed in order.
MapObject[] com.cartotype.Framework.findAddressPart | ( | int | aMaxObjectCount, |
String | aText, | ||
AddressPart | aAddressPart, | ||
boolean | aFuzzy, | ||
boolean | aIncremental | ||
) |
Finds part of an address used in an Address object, using the same search rules used for finding an entire address. If aIncremental is true, prefix-matching is used and this enables an address dialog to be populated incrementally; in this case it's a good idea to set aMaxObjectCount to a small number that is a suitable number of items to be displayed in a list box on the display, for example 20.
native int com.cartotype.Framework.findAsync | ( | FindAsyncInterface | aHandler, |
FindParam | aFindParam, | ||
boolean | aOverride | ||
) |
An asynchronous general find function using a FindParam parameter object.
Calls the handler() method of aHandler (from a different thread) with the map objects that have been found when the operation has been completed.
The object aHandler must remain in existence at least as long as this Framework object.
If aOverride is true, any pending asynchronous find operations that have not yet been started are deleted. Asynchronous find operations are executed in order.
native int com.cartotype.Framework.findAsyncGroups | ( | FindAsyncGroupInterface | aHandler, |
FindParam | aFindParam, | ||
boolean | aOverride | ||
) |
An asynchronous find function to make interactive searching easier. It returns map objects grouped by names which can be used to identify the groups in a list box. For example, a search for pubs using the word 'Red' as the search term might return one group with the name 'Red Lion' and another group with the name 'Red Cow'.
Calls the handler() method of aHandler (from a different thread) with the map object groups that have been found when the operation has been completed.
The object aHandler must remain in existence at least as long as this Framework object.
If aOverride is true, any pending asynchronous find operations that have not yet been started are deleted. Asynchronous find operations are executed in order.
Finds all the buildings near the map object aStreet, which must be a linear object. In practice, aStreet needs to have a name that is referred to by the addr:street attribute. The buildings returned are those within 50 meters of aStreet, plus those buildings up to 200 meters away with an addr:street attribute matching the street's name.
native MapObjectGroup[] com.cartotype.Framework.findGroups | ( | FindParam | aFindParam | ) |
A find function to make interactive searching easier. It returns map objects grouped by names which can be used to identify the groups in a list box. For example, a search for pubs using the word 'Red' as the search term might return one group with the name 'Red Lion' and another group with the name 'Red Cow'.
native MapObject[] com.cartotype.Framework.findInDisplay | ( | int | aMaxObjectCount, |
double | aX, | ||
double | aY, | ||
double | aRadius | ||
) |
Finds map objects within a certain radius of a point on the displayed map. The point and radius are given in display pixels. Unlike the other find functions, this function deals with the graphic representation of objects, so it will work correctly when the user clicks on an icon, but not on the actual location of the object represented by the icon.
MapObject[] com.cartotype.Framework.findInLayer | ( | int | aMaxObjectCount, |
String | aLayer, | ||
double | aX1, | ||
double | aY1, | ||
double | aX2, | ||
double | aY2, | ||
CoordType | aCoordType | ||
) |
Finds all the map objects in a certain rectangle, in a certain layer.
int com.cartotype.Framework.findNearestRoad | ( | NearestRoadInfo | aInfo, |
double | aX, | ||
double | aY, | ||
CoordType | aCoordType, | ||
double | aHeadingInDegrees, | ||
boolean | aDisplayPosition | ||
) |
Finds the nearest road to the point (aX,aY), returns information about it in aInfo, and optionally (if aDisplayPosition is true) sets the current location to that position. It is legal for aInfo or aParam or both to be null. Uses the current location match parameters.
Roads are defined as map objects allowed by the current routing filter and main route profile. If aHeadingInDegrees is valid (not negative) it is used to choose among roads going in different directions.
Returns a CartoType error code: 0 = success.
native MapObject[] com.cartotype.Framework.findPointsInPath | ( | Geometry | aPath, |
FindParam | aFindParam | ||
) |
Finds all point objects contained in a certain closed path. To use standard parameters pass null for aFindParam. To set parameters other than the path and the condition of finding points, pass a FindParam object with your chosen parameters.
native MapObject[] com.cartotype.Framework.findPolygonsContainingPath | ( | Geometry | aPath, |
FindParam | aFindParam | ||
) |
Finds all polygon objects containing a certain path. To use standard parameters pass null for aFindParam. To set parameters other than the path and the condition of finding polygons, pass a FindParam object with your chosen parameters.
native MapObject[] com.cartotype.Framework.findStreetAddresses | ( | int | aMaxObjectCount, |
Address | aAddress, | ||
Geometry | aClip | ||
) |
Finds all street addresses matching the supplied parameters.
In the address, only the building, street, locality, admin area, country and postcode are used; the other fields are ignored. One of the special characters '*', indicating a prefix search, or '~', indicating a fuzzy search, may be appended to any address field: for example, a postcode of 9040* searches for all postcodes starting with 9040.
The returned objects are either streets or buildings. If the building is specified, buildings are returned, otherwise streets are returned. To get all buildings in the selected streets, use '*' as the building.
MapObject[] com.cartotype.Framework.findText | ( | int | aMaxObjectCount, |
String | aText, | ||
int | aMatchMethod, | ||
String | aLayers, | ||
String | aAttributes | ||
) |
Finds map objects with attributes matching a certain string, restricting the search to selected attributes and layers. aLayers is a list of layer names separated by commas or spaces: for example, "lake,river". aAttributes is a list of string attribute names separated by commas or spaces, where $ stands for the main name of the object (the unnamed string attribute): for example, "$,ref". aLayers and aAttributes may be null or empty: if no layers are given, all layers are searched, and if no attributes are given, all attributes are searched.
Wild cards may be specified using the non-character Unicode codepoint U+FFFF.
int com.cartotype.Framework.getAddress | ( | Address | aAddress, |
double | aX, | ||
double | aY, | ||
CoordType | aCoordType | ||
) |
Gets an address for a point.
Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.
Returns a CartoType error code: 0 = success.
native boolean com.cartotype.Framework.getAnimateTransitions | ( | ) |
Returns true if transitions are smoothly animated in graphics-accelerated drawing.
double com.cartotype.Framework.getArea | ( | Geometry | aGeometry | ) |
Gets the area of a geometry object in square meters. Returns 0 if it is a point or a line.
native BlendStyle[] com.cartotype.Framework.getBlendStyleSet | ( | ) |
Returns the current blend style set, or null if no blend style is in force.
native double com.cartotype.Framework.getContinuationTurn | ( | Turn | aTurn | ) |
When navigating, gets the continuation turn if any and returns the distance to it in map metres from the first turn. If there is no continuation turn sets the turn type to Turn.TURN_NONE and returns 0;
double com.cartotype.Framework.getContourArea | ( | Geometry | aGeometry, |
int | aContourIndex | ||
) |
Gets the area of a contour of a geometry object in square meters. Returns 0 if it is a point or a line.
double com.cartotype.Framework.getContourLengthOrPerimeter | ( | Geometry | aGeometry, |
int | aContourIndex | ||
) |
Gets the length or perimeter of a contour of a geometry object in meters. Returns 0 if it is a point.
double com.cartotype.Framework.getDistanceInMeters | ( | double | aX1, |
double | aY1, | ||
double | aX2, | ||
double | aY2, | ||
CoordType | aCoordType | ||
) |
Gets the distance between two points.
native boolean com.cartotype.Framework.getDraw3DBuildings | ( | ) |
Returns true if buildings are drawn in 3D where data is available.
native double com.cartotype.Framework.getFirstTurn | ( | Turn | aTurn | ) |
When navigating, gets the first turn and returns the distance to it in map metres. If there is no nearby turn sets the turn type to Turn.TURN_NONE and return 0;
native int com.cartotype.Framework.getFollowMode | ( | ) |
Gets the follow mode, which controls the way the map tracks the user location and heading.
String com.cartotype.Framework.getGeoCodeSummary | ( | double | aX, |
double | aY, | ||
CoordType | aCoordType | ||
) |
Returns a string summarizing a geocode for a geographical location. The summary is a string version of the address returned by getAddress.
Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.
int com.cartotype.Framework.getHeight | ( | double | aX, |
double | aY, | ||
CoordType | aCoordType | ||
) |
Returns the height in metres at a single point, or -32768 if it is unavailable.
The layer 'terrain-height-metres' is used by preference. It contains heights to metre precision. If that layer is not available, the layer 'terrain-height-feet' is used, which contains heights to 100-foot precision.
int com.cartotype.Framework.getHeights | ( | double[] | aX, |
double[] | aY, | ||
int[] | aTerrainHeightArray, | ||
CoordType | aCoordType | ||
) |
Finds the heights of a set of points in the specified coordinate type. Heights are returned in metres.
The layer 'terrain-height-metres' is used by preference. It contains heights to metre precision. If that layer is not available, the layer 'terrain-height-feet' is used, which contains heights to 100-foot precision. Unknown heights are set to -32768.
Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.getLastMapHandle | ( | ) |
Gets the handle of the map most recently loaded, or created using CreateWritableMap.
long com.cartotype.Framework.getLastObjectId | ( | ) |
Returns the integer ID of the last object inserted into a writable map.
double com.cartotype.Framework.getLengthOrPerimeter | ( | Geometry | aGeometry | ) |
Gets the length or perimeter of a geometry object in meters. Returns 0 if it is a point.
native LocationMatchParam com.cartotype.Framework.getLocationMatchParam | ( | ) |
Gets the current location match parameters.
native int com.cartotype.Framework.getMainMapHandle | ( | ) |
Gets the handle of the main map.
Bitmap com.cartotype.Framework.getMap | ( | ) |
Gets the current map as a 32bpp RGBA bitmap. The returned image is valid till the next call to getMap or getMemoryDataBaseMap.
void com.cartotype.Framework.getMapExtent | ( | double[] | aPoint, |
CoordType | aCoordType | ||
) |
Gets the extent of the map. If aPoint has two or more members puts the view center in aPoint[0] and aPoint[1]. If aPoint has six or more members, also puts the view rectangle in aPoint[2] ... aPoint[5] in the order left, top, right, bottom.
native MapMetaData com.cartotype.Framework.getMapMetaData | ( | int | aIndex | ) |
Returns the metadata for a map, identified by its index, if available. Returns null if no metadata is available. Metadata is currently available only for CTM1 maps.
Bitmap com.cartotype.Framework.getMemoryDataBaseMap | ( | ) |
Gets an image showing objects from the in-memory database only as a 32bpp RGBA bitmap. The returned image is valid till the next call to getMap or getMemoryDataBaseMap.
native int com.cartotype.Framework.getMemoryMapHandle | ( | ) |
Gets the handle of the in-memory map used for routing.
int com.cartotype.Framework.getNavigationPosition | ( | double[] | aPoint, |
CoordType | aCoordType | ||
) |
Gets the current position used by the navigation system. This may be an extrapolated position. The position is returned in aPoint, which must have at least two elements. Returns a CartoType error code (0 = success).
NavigationState com.cartotype.Framework.getNavigationState | ( | ) |
Returns the navigation state.
native NavigatorParam com.cartotype.Framework.getNavigatorParam | ( | ) |
Returns the parameters controlling the way navigation works.
native boolean com.cartotype.Framework.getNightMode | ( | ) |
Returns true if night mode is on.
native int com.cartotype.Framework.getNightModeColor | ( | ) |
Returns the current night mode color.
native boolean com.cartotype.Framework.getPerspective | ( | ) |
Returns true if the perspective view is turned on, false otherwise.
native PerspectiveParam com.cartotype.Framework.getPerspectiveParam | ( | ) |
Returns the current perspective parameters.
native String com.cartotype.Framework.getProjectionAsProj4Param | ( | ) |
Gets the current map projection as a proj.4 parameter string if possible. If not returns the empty string.
native double com.cartotype.Framework.getRotation | ( | ) |
Gets the current rotation angle of the map in degrees.
Route com.cartotype.Framework.getRoute | ( | int | aIndex | ) |
Gets one of the current routes. Returns null if the selected route does not exist.
native int com.cartotype.Framework.getRouteCount | ( | ) |
Returns the number of routes in existence.
native String com.cartotype.Framework.getRouteInstructions | ( | Route | aRoute | ) |
Gets instructions for the route in the language of the current locale, or in English if that language is not available.
native int com.cartotype.Framework.getScale | ( | ) |
Gets the map's scale denominator.
native int com.cartotype.Framework.getScaleDenominatorInView | ( | ) |
Gets the map's scale denominator for the center of the current view, compensating for local scale distortion caused by the projection.
native double com.cartotype.Framework.getSecondTurn | ( | Turn | aTurn | ) |
When navigating, gets the second turn and returns the distance to it in map metres from the first turn. If there is no nearby second turn sets the turn type to Turn.TURN_NONE and returns 0;
Bitmap com.cartotype.Framework.getTileBitmap | ( | int | aTileSizeInPixels, |
int | aZoom, | ||
int | aX, | ||
int | aY | ||
) |
Gets an image containing a tile of the required coordinates and size, using OpenStreetMap tile coordinates. The returned image is valid till the next call to getTileBitmap. This function works properly only if the map is in the Web Mercator projection.
Geometry com.cartotype.Framework.getTrack | ( | ) |
Returns the current track as a geometry object with coordinates in degrees. Each segment of the track is a contour in the geometry object.
void com.cartotype.Framework.getViewDimensions | ( | double[] | aPoint, |
CoordType | aCoordType | ||
) |
Gets the view dimensions. If aPoint has two or more members puts the view center in aPoint[0] and aPoint[1]. If aPoint has six or more members, also puts the view rectangle in aPoint[2] ... aPoint[5] in the order left, top, right, bottom.
native ViewState com.cartotype.Framework.getViewState | ( | ) |
Returns the current view state.
native boolean com.cartotype.Framework.hasNotices | ( | ) |
Returns true if any notices such as a scale bar, legend or copyright notice exist.
int com.cartotype.Framework.insertCircleMapObject | ( | int | aMapHandle, |
String | aLayerName, | ||
double | aCenterX, | ||
double | aCenterY, | ||
CoordType | aCenterCoordType, | ||
double | aRadius, | ||
CoordType | aRadiusCoordType, | ||
String | aStringAttributes, | ||
int | aIntAttribute, | ||
long | aId, | ||
boolean | aReplace | ||
) |
Inserts a circular map object into one of the writable maps, identifying the map by its handle. The circle is defined by its center and radius, which may have different coordinate types. It is often convenient to supply a point in degrees and its radius in map meters. Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). This function fails if the map is not writable. If aReplace is true and aId is a duplicate of an existing object, the existing object is replaced, otherwise a duplicate causes the function to fail. Returns a CartoType result code: 0 = success.
int com.cartotype.Framework.insertCopyOfMapObject | ( | int | aMapHandle, |
String | aLayername, | ||
MapObject | aMapObject, | ||
double | aEnvelopeRadius, | ||
CoordType | aRadiusCoordType, | ||
long | aId, | ||
boolean | aReplace | ||
) |
Inserts an object by copying an existing object. If aEnvelopeRadius is greater than zero, converts the object to an envelope using the specified radius. Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). This function fails if the map is not writable. If aReplace is true and aId is a duplicate of an existing object, the existing object is replaced, otherwise a duplicate causes the function to fail. Returns a CartoType result code: 0 = success.
int com.cartotype.Framework.insertEnvelopeMapObject | ( | int | aMapHandle, |
String | aLayerName, | ||
Geometry | aGeometry, | ||
double | aRadius, | ||
CoordType | aRadiusCoordType, | ||
String | aStringAttributes, | ||
int | aIntAttribute, | ||
long | aId, | ||
boolean | aReplace | ||
) |
Inserts an envelope map object into one of the writable maps, identifying the map by its handle. An envelope is a continuous curve at a certain distance from some geometry, and can be regarded as a stroke of width aRadius drawn along a path. It is often convenient to supply the geometry in degrees and the radius in map meters. Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). This function fails if the map is not writable. If aReplace is true and aId is a duplicate of an existing object, the existing object is replaced, otherwise a duplicate causes the function to fail. Returns a CartoType result code: 0 = success.
native int com.cartotype.Framework.insertMapObject | ( | int | aMapHandle, |
String | aLayerName, | ||
Geometry | aGeometry, | ||
String | aStringAttributes, | ||
int | aIntAttribute, | ||
long | aId, | ||
boolean | aReplace | ||
) |
Inserts a map object into one of the writable maps. If aMapHandle is zero the in-memory map used for routing is used. The type of the map object (point, line or polygon) is deduced from the geometry object. Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). This function fails if the map is not writable. If aReplace is true and aId is a duplicate of an existing object, the existing object is replaced, otherwise a duplicate causes the function to fail. Returns a CartoType result code: 0 = success.
int com.cartotype.Framework.insertPointMapObject | ( | int | aMapHandle, |
String | aLayerName, | ||
double | aX, | ||
double | aY, | ||
CoordType | aCoordType, | ||
String | aStringAttributes, | ||
int | aIntAttribute, | ||
long | aId, | ||
boolean | aReplace | ||
) |
Inserts a point map object into one of the writable maps, identifying the map by its handle. Uses the supplied ID if aId is non-zero, otherwise generates an ID which can be retrieved using getLastObjectId(). This function fails if the map is not writable. If aReplace is true and aId is a duplicate of an existing object, the existing object is replaced, otherwise a duplicate causes the function to fail. Returns a CartoType result code: 0 = success.
int com.cartotype.Framework.insertPushPin | ( | double | aX, |
double | aY, | ||
CoordType | aCoordType, | ||
String | aStringAttributes, | ||
String | aColor, | ||
int | aIconCharacter, | ||
long | aId | ||
) |
Inserts a pushpin: a point object belonging to the 'pushpin' layer. The pushpin is inserted into the built-in modifiable map.
If aColor is not empty it is used as the _color attribute, which, in the standard style sheet, causes the pushpin icon to be drawn in that color instead of the standard color.
If aIconCharacter is not zero it is used to set the _iconText attributes, which, in the standard style sheet, causes that character to be used as an icon. The MapKeyIcons font is supplied with CartoType and contains icons in the private-character range U+E002...U+E0B1.
If aId is zero, a new pushpin is inserted and its ID is returned in aId. If aId is non-zero, an existing pushpin with the specified ID, if any exists, is replaced.
|
static |
Constructs an integer attribute from an optional three-letter code, placed in the high 16 bits by encoding each letter in five bits, and a type number placed in the low 16 bits.
The three-letter code is used only if it consists of exactly three lower-case letters in the range a...z.
Three-letter codes are used for mnemonic purposes, as for example "pub" for a public house, and can be tested easily in style sheets.
native String[] com.cartotype.Framework.layerNames | ( | ) |
Returns the names of all the layers in the map data.
native int com.cartotype.Framework.license | ( | String | aKey | ) |
Supplies a license key to remove the map watermark and other restrictions. Returns an error code.
native String com.cartotype.Framework.licensee | ( | ) |
Returns the name of the licensee, or "no licensee: for evaluation only".
native int com.cartotype.Framework.loadFont | ( | String | aFontFileName | ) |
Loads a font in addition to any fonts already loaded. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.loadIcon | ( | String | aFileName, |
String | aId, | ||
int | aHotSpotX, | ||
int | aHotSpotY, | ||
int | aLabelX, | ||
int | aLabelY, | ||
int | aLabelMaxLength | ||
) |
Loads an icon from a file. It will be used whenever the ID aId is referenced in the style sheet, overriding any icon specified in the style sheet.
The icon file may be in PNG or JPEG format.
(aHotSpotX,aHotSpotY) is the point, relative to the top left corner of the icon, that should be made to coincide with the point of interest marked by the icon.
(aLabelX,aLabelY) is the point, relative to the hot spot, at which the center of the baseline of any label text is placed.
aLabelMaxLength is the maximum length of label text in pixels. Labels too long to be drawn on the icon are drawn next to it.
Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.loadMap | ( | String | aMapFileName | ) |
Loads another map, in addition to the main one loaded by the constructor. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.loadMap | ( | String | aMapFileName, |
byte[] | aMapEncryptionKey | ||
) |
Loads another map, in addition to the main one loaded by the constructor. If aMapEncryptionKey is non-null the map must have been encrypted using it. Returns a CartoType result code: 0 = success.
native MapObject com.cartotype.Framework.loadMapObject | ( | int | aMapHandle, |
long | aObjectId | ||
) |
Loads a map object from a map. Returns null if the object doesn't exist.
native int com.cartotype.Framework.loadNavigationData | ( | ) |
Loads navigation data for the current map. This function is optional. If it is not called, navigation data will be loaded automatically when first needed. It is provided so that the time overhead of loading navigation data can be incurred at a predictable stage, for example at application startup.
Returns a CartoType error code: 0 = success. No error is returned if navigation data has already been loaded.
native String com.cartotype.Framework.locale | ( | ) |
Returns the locale used when getting the names of map objects when routing, geocoding, etc. The returned value is either a null-terminated string, usually a two-letter language identifier like 'en' for English or 'fr' for French, or an empty string meaning 'no locale'.
native int com.cartotype.Framework.mapCount | ( | ) |
Returns the number of maps currently loaded, including the main map and the in-memory map.
native boolean com.cartotype.Framework.mapIsEmpty | ( | int | aHandle | ) |
Returns true if a map, identified by its handle, is known to be empty or does not exist.
native double com.cartotype.Framework.metersToPixels | ( | double | aMeters | ) |
Converts a distance in map meters (projected meters) to pixels.
native int com.cartotype.Framework.navigate | ( | int | aValidity, |
double | aTime, | ||
double | aLong, | ||
double | aLat, | ||
double | aSpeed, | ||
double | aCourse, | ||
double | aHeight | ||
) |
Updates the vehicle position and, if navigating, updates the navigation state.
In order to implement turn-by-turn navigation, you should call navigate() at frequent intervals (once per second is good enough) after creating a route using startNavigation(), readRouteFromXml(), etc.
When not navigating, you may call this function to update the vehicle position if necessary (i.e., if the current follow mode displays the vehicle position: see setFollowMode()).
aValidity is a set of bit flags, ORed together, which determines which of the other parameters are valid. The bit flags are the constants Framework.TIME_VALID, Framework.POSITION_VALID, Framework.SPEED_VALID, Framework.COURSE_VALID and Framework.HEIGHT_VALID. For normal navigation not all the data is necessary: you need supply the time and position only. Other data, if available, helps the navigation system decide which road the vehicle is on, and extrapolate positions. The height (elevation above sea level) is not currently used.
aTime is the time in seconds. Any consistent time representation may be used (e.g., the unix timestamp format of the time in seconds since midnight, 1st Jan 1970); the absolute time does not matter as long as times can be subtracted to give a difference in seconds.
aLong and aLat are the location in degrees longitude and latitude, using the WGS84 datum.
aSpeed is the speed in kilometres per hour.
aCourse is the true course in degrees, where 0 is north, and degrees increase clockwise; 90 is east, 180 is south, and 270 is west.
aHeight is the height above sea level in metres.
If the position is invalid, navigate() guesses the position by extrapolating from the current speed, if known, and the previous position.
After navigate() has been called, the map position, rotation or zoom will change according to the current follow mode (see setFollowMode()).
If you are not using graphics acceleration you should redraw the map after calling this function.
Returns a CartoType error code: 0 = success.
native boolean com.cartotype.Framework.navigationEnabled | ( | ) |
Returns true if navigation is enabled, false otherwise.
void com.cartotype.Framework.onDynamicDataChange | ( | ) |
This virtual function is called when the dynamic data changes, which can be caused by creating or deleting a route, or inserting or deleting a pushpin or other dynamic map object.
void com.cartotype.Framework.onMainDataChange | ( | ) |
This virtual function is called when the map data changes, which can be caused by loading a new map, unloading a map, enabling or disabling a map, enabling or disabling a layer, or changing the style sheet.
void com.cartotype.Framework.onViewChange | ( | ) |
This virtual function is called when the map view changes, which can be caused by panning, zooming, rotation, moving to a new location, or resizing the map.
native void com.cartotype.Framework.pan | ( | int | aDx, |
int | aDy | ||
) |
Pans (slides the map) by a certain distance in pixels, horizontally or vertically or both.
void com.cartotype.Framework.panFromTo | ( | double | aFromX, |
double | aFromY, | ||
CoordType | aFromCoordType, | ||
double | aToX, | ||
double | aToY, | ||
CoordType | aToCoordType | ||
) |
Pans (slides the map) so that the position aFromX,aFromY moves to aToX,aToY.
native double com.cartotype.Framework.pixelsToMeters | ( | double | aPixels | ) |
Converts a distance in pixels to map meters (projected meters).
RouterType com.cartotype.Framework.preferredRouterType | ( | ) |
Returns the preferred type of router to be used for calculating routes.
native RouteProfile com.cartotype.Framework.profile | ( | int | aIndex | ) |
Returns one of the active route profiles, or null if the index is out of range. The index 0 always works, and returns the main route profile.
Geometry com.cartotype.Framework.range | ( | RouteProfile | aProfile, |
double | aX, | ||
double | aY, | ||
CoordType | aCoordType, | ||
double | aTimeOrDistance, | ||
boolean | aIsTime | ||
) |
Returns the range: a polygon containing the area reachable within a certain time in seconds or distance in meters.
Uses the supplied route profile if it is non-null, otherwise the current profile. If a time is supplied, the profile's bonuses and penalties are suppressed. If a distance is supplied, shortest routes are used. You can optionally insert the returned Geometry object into the map using insertMapObject.
native int com.cartotype.Framework.readGpx | ( | int | aMapHandle, |
String | aFileName | ||
) |
Reads route and track objects from a GPX file and inserts them into the map identified by aMapHandle. This function fails if the map is not writable.
Waypoint objects (wpt) are made into points in the gpx/wpt layer. Route objects (rte) are made into lines in the gpx/rte layer. Track objects (trk) are made into lines in the gpx/trk layer.
int com.cartotype.Framework.readMap | ( | int | aHandle, |
byte[] | aData | ||
) |
Reads map data from aData in CTMS format and merges it into the map identified by aHandle, which must refer to a writable map database. If aMapHandle is zero it means the in-memory map used for routing. Returns a CartoType result code: 0 = success.
int com.cartotype.Framework.readMap | ( | int | aHandle, |
String | aFileName, | ||
FileType | aFileType | ||
) |
Reads map data from aFileName in the format given by aFileType and merges it into the map identified by aHandle, which must refer to a writable map database. Only the CTMS (CartoType Map Serialized) and KML (Keyhole Markup Language) file types are currently supported. Returns a CartoType result code: 0 = success.
native int com.cartotype.Framework.readRouteFromXml | ( | String | aFileNameOrData, |
boolean | aReplace | ||
) |
Reads a route from XML (a GPX file or a CartoType route file) and displays it. aFileNameOrData is treated as XML data if it starts with a less-than sign.
If aReplace is true, deletes all current routes, adds the new route and makes its profile the current profile. If aReplace is false, appends the new route to the list of current routes.
Appending a route fails if the new route has a different start and end point, or intermediate waypoints, from the current routes.
This function resets the navigation state and enables navigation.
native int com.cartotype.Framework.reloadStyleSheet | ( | int | aIndex | ) |
Reloads a sheet from the file it was originally loaded from. This function can be used to apply changes after a style sheet is modified. The index aIndex determines which style sheet is reloaded: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets. Only style sheets loaded from files can be reloaded. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.resize | ( | int | aViewWidth, |
int | aViewHeight | ||
) |
Resizes the map view, supplying the new view width and height in pixels. Returns an error code.
native double com.cartotype.Framework.resolutionDpi | ( | ) |
Gets the display resolution used by CartoType in dots per inch.
native int com.cartotype.Framework.reverseRoutes | ( | ) |
Reverses the order of the current route points, recreates the route or routes, and displays them on the map. The two directions of the same route may not follow the same path because of one-way streets and turn restrictions. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.rotate | ( | double | aAngle | ) |
Rotates the map about its center by an angle given in degrees. Returns an error code.
int com.cartotype.Framework.rotateAt | ( | double | aAngle, |
double | aX, | ||
double | aY, | ||
CoordType | aCoordType | ||
) |
Rotates the map about a specified point by an angle in degrees.
RouteAccess com.cartotype.Framework.routeAccess | ( | double | aX, |
double | aY, | ||
CoordType | aCoordType | ||
) |
Returns the accessibility of a point for routing purposes. A point is defined as accessible if it is connected to at least 1000 other route segments.
byte[] com.cartotype.Framework.saveMap | ( | int | aHandle, |
FindParam | aFindParam | ||
) |
Saves a map identified by its handle by writing it as an array of bytes in CTMS format. aFindParam, if non-null, can be used to select the objects to be saved. If aMapHandle is zero it means the in-memory map used for routing. If the function fails it returns a single-byte array containing an error code.
int com.cartotype.Framework.saveMap | ( | int | aHandle, |
String | aFileName, | ||
FileType | aFileType | ||
) |
Saves a map identified by its handle by writing it the specified format. Only writable map databases may be saved in this way. Only the CTMS (CartoType Map Serialized), CTSQL (CartoType SQL format) and KML (Keyhole Markup Language) file types are currently supported. Returns a CartoType result code: 0 = success.
native boolean com.cartotype.Framework.setAnimateTransitions | ( | boolean | aEnable | ) |
Enables or disables smoothly animated transitions in graphics-accelerated drawing. Returns the previous enabled state.
native BlendStyle[] com.cartotype.Framework.setBlendStyle | ( | BlendStyle[] | aBlendStyleSet | ) |
Sets a blend style, or, if aBlendStyleSet is null or empty, removes the current blend style. If night mode is on, night mode is turned off and replaced by the specified blend style or by no blend style. Returns the previous blend style, which is empty if none is in force.
native int com.cartotype.Framework.setBuiltInProfile | ( | int | aIndex | ) |
Selects a built-in routing profile by its index. Routers allowing an arbitrary profile to be set have no built-in profiles. The contraction hierarchy router has one or more built-in profiles.
Returns a CartoType error code: 0 = success.
String com.cartotype.Framework.setCase | ( | String | aString, |
LetterCase | aCase | ||
) |
Sets the letter case of a string.
Supports all UTF-16 characters. Uses the title-case exception dictionary to prevent words like 'of' being capitalised. Returns the modified string. Does not change aString.
|
static |
Creates a color value by modifying the alpha value of an existing color.
void com.cartotype.Framework.setCopyrightNotice | ( | ) |
Sets the copyright notice displayed at the bottom-right corner of the map to that of the main map database.
void com.cartotype.Framework.setCopyrightNotice | ( | String | aCopyright | ) |
Sets the copyright notice displayed at the bottom-right corner of the map.
native boolean com.cartotype.Framework.setDraw3DBuildings | ( | boolean | aEnable | ) |
Enables or disables the drawing of 3D buildings where data is available. Returns the previous enabled state.
native int com.cartotype.Framework.setFollowMode | ( | int | aFollowMode | ) |
Sets the follow mode, which controls the way the map tracks the user location and heading. The parameter aFollowMode is one of the FOLLOW_MODE_* constants. Returns a CartoType error code (0 = success).
void com.cartotype.Framework.setLegend | ( | Legend | aLegend, |
double | aWidth, | ||
String | aUnit, | ||
ExtendedNoticePosition | aPosition | ||
) |
Sets the legend: map key or scale or both. The parameter aLegend is copied and need not be preserved after calling this function.
void com.cartotype.Framework.setLegend | ( | Legend | aLegend, |
double | aWidth, | ||
String | aUnit, | ||
NoticePosition | aPosition | ||
) |
Sets the legend: map key or scale or both. The parameter aLegend is copied and need not be preserved after calling this function.
native void com.cartotype.Framework.setLocale | ( | String | aLocale | ) |
Sets the locale used when getting the names of map objects when routing, geocoding, etc. The value of aLocale is usually a two-letter language identifier like 'en' for English or 'fr' for French. Passing an empty or null string sets the locale to 'no locale'.
native void com.cartotype.Framework.setLocationMatchParam | ( | LocationMatchParam | aParam | ) |
Sets the current location match parameters. These parameters are used when creating routes in functions which do not receive explicit location match parameters. In functions which do receive location match parameters, any parameters with the value 0 are replaced by the current location match parameters set by this function.
native int com.cartotype.Framework.setMainProfile | ( | RouteProfile | aProfile | ) |
Sets the main routing profile. If you do not call this function, the standard profile for private car routing is used.
This function has no effect if routing is performed on a map with a built-in contraction-hierarchy routing table (created using makemap /route=ch), because such a table is created using one or more fixed routing profiles which can be set in makemap. Use setBuiltInProfile for contraction hierarchy routing. Returns an error code.
native boolean com.cartotype.Framework.setMapsOverlap | ( | boolean | aEnable | ) |
Determines whether newly loaded maps are allowed to overlap. Non-overlapping maps are clipped against other non-overlapping maps. This function does not affect maps already loaded. Returns the previous state.
native void com.cartotype.Framework.setNavigatorAutoReRoute | ( | boolean | aAutoReRoute | ) |
Turns auto-re-routing in navigation on or off. By default it is turned on. If not, If not, when re-routing is needed, the navigation state NAVIGATION_STATE_RE_ROUTE_NEEDED is entered and the route is recalculated the next time a valid location is provided by a call to navigate(). This gives the application time to issue a warning if the routing algorithm is likely to be slow.
native void com.cartotype.Framework.setNavigatorDistanceTolerance | ( | int | aMeters | ) |
Sets the navigator's distance tolerance in meters. The navigation state is set to off-route if the current position is at least this far from any part of the route.
native void com.cartotype.Framework.setNavigatorMinimumFixDistance | ( | int | aMeters | ) |
Sets the navigator's minimum fix distance in meters. A location update is ignored if it is less than this distance from the location last supplied (and not ignored) to the navigate() function.
native void com.cartotype.Framework.setNavigatorParam | ( | NavigatorParam | aNavigatorParam | ) |
Sets the parameters controlling the way navigation works.
native void com.cartotype.Framework.setNavigatorTimeTolerance | ( | int | aSeconds | ) |
Set the navigator's time-off-route tolerance in seconds. A new route is calculated if the current position has been off route for this long.
native int com.cartotype.Framework.setNearbyObjectWarning | ( | int | aId, |
String | aLayer, | ||
String | aCondition, | ||
double | aMaxDistance, | ||
int | aMaxObjectCount | ||
) |
Adds or replaces a nearby object warning. Objects found are added to the 'nearby' layer while the warning is in force. The attribute '_warning=0' is set.
Objects in aLayer, satisfying aCondition if it is not empty, and within aMaxDistance of the current point, are highlighted. The parameter aLayer may contain wild cards or end in a '/' sign.
The parameter aMaxObjectCount is the maximum number of objects to be found, which is clamped to the range 0...1024. If it is zero, the default of 32 is used. If more objects are actually found, the closest ones are used.
If aId is zero, a new warning is created. If aId is non-zero, the existing warning if any with an ID of aId is replaced. The ID of the new or replaced warning is returned. If aMaxDistance, which is in meters, is less than or equal to zero, it is set to the default distance of 1000, or 1km.
Returns 0 if no warning was created, which occurs if aLayer was empty, or the navigation system could not be created.
native boolean com.cartotype.Framework.setNightMode | ( | boolean | aSet | ) |
Sets night mode and returns the previous setting. In night mode the map is shaded dark blue and roads are made brighter than other features.
native int com.cartotype.Framework.setNightModeColor | ( | int | aColor | ) |
Sets the night mode color, which should be a dark color (although this is not enforced), and returns the previous night mode color.
To set a custom blend fraction, use the alpha value. For example, set the color's alpha value to 153 to blend the night mode color with a style color in the ratio 0.6 : 0.4 (153/255 = 0.6). Use an alpha value of 255 to get the default blend fraction.
Roads use the night mode color blended with 50% white, and half the specified blend fraction. This increases contrast between roads and other features.
native void com.cartotype.Framework.setPerspective | ( | boolean | aEnable | ) |
Turns perspective view on or off.
void com.cartotype.Framework.setPerspective | ( | PerspectiveParam | aParam | ) |
Turns perspective mode on and uses the supplied perspective parameters.
void com.cartotype.Framework.setPreferredRouterType | ( | RouterType | aRouterType | ) |
Sets the preferred type of router to be used for calculating routes. Different routers have various advantages and disadvantages, such as using more or less memory, being faster or slower, or producing more useful routes.
Calling this function causes navigation data to be unloaded if the current navigation data uses a different type of router.
native void com.cartotype.Framework.setResolutionDpi | ( | int | aDpi | ) |
Sets the display resolution used by CartoType in dots per inch. It has to be set correctly for map scaling and lettering to work.
native int com.cartotype.Framework.setRotation | ( | double | aAngle | ) |
Sets the map's orientation to an absolute angle given in degrees. Zero = north-up. Returns an error code.
int com.cartotype.Framework.setRotationAt | ( | double | aAngle, |
double | aX, | ||
double | aY, | ||
CoordType | aCoordType | ||
) |
Sets the map's orientation to a rotation about a specified point by an absolute angle given in degrees. Zero = north-up.
native int com.cartotype.Framework.setScale | ( | int | aScale | ) |
Sets the map's scale denominator. Returns an error code.
void com.cartotype.Framework.setScaleBar | ( | boolean | aMetricUnits, |
double | aWidth, | ||
String | aUnit, | ||
ExtendedNoticePosition | aPosition | ||
) |
Creates a scale bar in either metric or imperial units, with a specified width and position in the display.
void com.cartotype.Framework.setScaleBar | ( | boolean | aMetricUnits, |
double | aWidth, | ||
String | aUnit, | ||
NoticePosition | aPosition | ||
) |
Creates a scale bar in either metric or imperial units, with a specified width and position in the display.
native int com.cartotype.Framework.setScaleDenominatorInView | ( | int | aScale | ) |
Sets the map's scale denominator in the current view, compensating for local scale distortion caused by the projection. Returns an error code.
int com.cartotype.Framework.setStyleSheet | ( | byte[] | aData, |
int | aIndex | ||
) |
Sets a style sheet by loading it from data in memory. The index aIndex determines which style sheet to replace: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.setStyleSheet | ( | String | aStyleSheetFileName, |
int | aIndex | ||
) |
Sets a style sheet by loading it from a file. The index aIndex determines which style sheet to replace: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets. Returns a CartoType error code: 0 = success.
void com.cartotype.Framework.setStyleSheetVariable | ( | String | aVariableName, |
int | aValue | ||
) |
Sets a style sheet variable to an integer value.
native void com.cartotype.Framework.setStyleSheetVariable | ( | String | aVariableName, |
String | aValue | ||
) |
Sets a style sheet variable to a string value. If the string value is null, clears the style sheet variable.
native int com.cartotype.Framework.setTileOverSizeZoomLevels | ( | int | aLevels | ) |
Sets the number of zoom levels by which to zoom out when creating a tile bitmap returned by getTileBitmap().
The number may be 0, 1, or 2. If it is 0, each tile is self-contained. If it is 1, each tile is cut from a larger tile containing four tiles. If it is 2, each tile is cut from a larger tile containing sixteen tiles. The values 1 and 2 are useful in allowing longer labels to be used when creating small tiles; if not, many street labels will not be drawn because the street is cut in two by the tile border and the resulting sections are too short.
The return value is the previous setting.
int com.cartotype.Framework.setTurnInstructions | ( | boolean | aMetricUnits, |
boolean | aAbbreviate, | ||
double | aWidth, | ||
String | aWidthUnit, | ||
ExtendedNoticePosition | aPosition, | ||
double | aTextSize, | ||
String | aTextSizeUnit | ||
) |
Creates turn instructions in either metric or imperial units, with a specified width and position in the display. Returns an error code.
int com.cartotype.Framework.setTurnInstructions | ( | boolean | aMetricUnits, |
boolean | aAbbreviate, | ||
double | aWidth, | ||
String | aWidthUnit, | ||
NoticePosition | aPosition, | ||
double | aTextSize, | ||
String | aTextSizeUnit | ||
) |
Creates turn instructions in either metric or imperial units, with a specified width and position in the display. Returns an error code.
native void com.cartotype.Framework.setTurnInstructionText | ( | String | aText | ) |
Sets the instruction to be displayed for the current turn, overriding automatically generated instructions. To revert to automatically generated instructions, call this function with empty or null text. This function has no effect if turn instructions have not been created using setTurnInstructions, or have been disabled by calling enableTurnInstructions(false).
native void com.cartotype.Framework.setVehiclePosOffset | ( | double | aXOffset, |
double | aYOffset | ||
) |
Sets the vehicle position when navigating as an offset from the center of the display, in units of the width and height of the display. For example, to show the vehicle in the middle but three quarters of the way down the display, use (0,0.25).
native int com.cartotype.Framework.setVehicleTypeWarning | ( | double | aMaxDistance, |
int | aMaxObjectCount | ||
) |
Adds a vehicle type warning and returns its ID. Road sections illegal for the current vehicle weight, dimensions or cargo type are found.
Objects found are added to the 'nearby' layer while the warning is in force. The attribute '_warning=1' is set.
The parameter aMaxObjectCount is the maximum number of objects to be found, which is clamped to the range 0...1024. If it is zero, the default of 32 is used. If more objects are actually found, the closest ones are used.
If there is already a vehicle type warning it is replaced by this one.
Returns 0 if no warning was created, which occurs if aLayer was empty, or the navigation system could not be created.
int com.cartotype.Framework.setView | ( | double | aX1, |
double | aY1, | ||
double | aX2, | ||
double | aY2, | ||
CoordType | aCoordType, | ||
int | aMarginInPixels, | ||
int | aMinScaleDenominator | ||
) |
Sets the view to show a certain rectangle, with a margin in pixels, and at a minimum scale. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.setView | ( | Geometry | aGeometry, |
int | aMarginInPixels, | ||
int | aMinScaleDenominator | ||
) |
Sets the view to show certain geometry, with a margin in pixels, and at a minimum scale. Returns a CartoType error code: 0 = success.
void com.cartotype.Framework.setView | ( | MapObject | aMapObject, |
int | aMarginInPixels, | ||
int | aMinScaleDenominator | ||
) |
Sets the view to show a single map object, with a margin in pixels, and at a minimum scale.
int com.cartotype.Framework.setView | ( | MapObject[] | aMapObjectArray, |
int | aMarginInPixels, | ||
int | aMinScaleDenominator | ||
) |
Set the view to show a group of map objects, with a margin in pixels, and at a minimum scale. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.setView | ( | ViewState | aViewState | ) |
Sets the view to a certain view state. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.setViewCenterLatLong | ( | double | aLong, |
double | aLat | ||
) |
Sets the center of the view to a point given in degrees longitude and latitude. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.setViewLimits | ( | double | aMinScaleDenominator, |
double | aMaxScaleDenominator, | ||
Geometry | aPanArea | ||
) |
Sets the limits to zooming and panning.
Zooming is restricted to the range between aMinScaleDenominator and aMaxScaleDenominator, and panning is restricted so that the edges of the display always touch the bounds of aPanArea.
Use the value zero to remove either or both of the two zoom limits. Use an empty (not null) geometry object to remove panning limits. Use a null geometry object to limit panning to the extent of the map. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.setViewToRoute | ( | int | aRouteIndex, |
int | aMarginInPixels, | ||
int | aMinScaleDenominator | ||
) |
Sets the view to one of the current routes, selected by its index (0 means the main route), with a margin in pixels, and at a minimum scale. This function does nothing if the selected route doesn't exist. Returns a CartoType error code: 0 = success.
native int com.cartotype.Framework.setViewToWholeMap | ( | ) |
Shows the whole map, zooming out as far as necessary. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.startNavigation | ( | double | aStartX, |
double | aStartY, | ||
CoordType | aStartCoordType, | ||
double | aEndX, | ||
double | aEndY, | ||
CoordType | aEndCoordType | ||
) |
Starts navigating from one point to another. Creates the route and displays it. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.startNavigation | ( | double[] | aX, |
double[] | aY, | ||
CoordType | aCoordType | ||
) |
Starts navigating through a series of points. Creates the route and displays it. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.startNavigation | ( | RouteCoordSet | aCoordSet | ) |
Starts navigating through a series of points. Creates the route and displays it. Returns a CartoType error code: 0 = success.
native void com.cartotype.Framework.startTracking | ( | ) |
Starts tracking (storing and displaying track points) and starts a new track segment. If tracking is turned on, a track point is added every time a new position fix is supplied using Navigate, if the position is far enough from the previous track point.
TimeAndDistanceMatrix com.cartotype.Framework.timeAndDistanceMatrix | ( | double[] | aFrom, |
double[] | aTo, | ||
CoordType | aCoordType | ||
) |
Returns an object containing route times in seconds and distances in metres from aFrom to all points in aTo; the arrays aFrom and aTo must contain pairs of coordinates in (x,y) order. If routing fails for any pair of points the time and distance are set to 0xFFFFFFFF. It is legal for aFrom to refer to the same set of points as aTo. Times and distances where the start and end point are the same are set to zero. If there illegal arguments or an error occurs, a null object is returned.
native boolean com.cartotype.Framework.tracking | ( | ) |
Returns true if tracking (storing and displaying track points) is on.
native double com.cartotype.Framework.trackLengthInMeters | ( | ) |
Returns the length of the current track in meters.
native String com.cartotype.Framework.turnInstructionText | ( | ) |
Gets the instruction to be displayed for the current turn. This function returns an empty string if turn instructions have not been created using setTurnInstructions.
native void com.cartotype.Framework.unloadIcon | ( | String | aId | ) |
Unloads an icon previously loaded using LoadIcon.
native int com.cartotype.Framework.unloadMap | ( | int | aHandle | ) |
Unloads a map, selecting it by handle. It is illegal to unload the main map database or the in-memory database. Returns a CartoType result code: 0 = success.
native int com.cartotype.Framework.useRoute | ( | Route | aRoute, |
boolean | aReplace | ||
) |
Loads an existing route and displays it.
If aReplace is true, deletes all current routes and adds the new route. If aReplace is false, appends the new route to the list of current routes.
Appending a route fails if the new route has a different start and end point, or intermediate waypoints, from the current routes.
This function resets the navigation state.
Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.writeMapImage | ( | String | aFileName, |
FileType | aFileType, | ||
boolean | aCompress | ||
) |
Writes a map image to a file of the specified type. Only the PNG file type is supported. If aCompress is true, uses lossy compression to reduce the file size. For PNG files compression is achieved by palettization. Returns a CartoType result code: 0 = success.
Writes a route as XML in the format selected by aFileType: FileType.CTROUTE or FileType.GPX. Returns a CartoType error code: 0 = success.
Writes a route as an XML string, in the format selected by aFileType: FileType.CTROUTE or FileType.GPX. Returns null if the file format is not supported.
native int com.cartotype.Framework.writeTrackAsXml | ( | String | aFileName | ) |
Writes the current track to a file as XML in GPX format. Returns an error code; 0 means success.
native String com.cartotype.Framework.writeTrackAsXmlString | ( | ) |
Writes the current track to a string as XML in GPX format.
native int com.cartotype.Framework.zoom | ( | double | aZoomFactor | ) |
Zooms by the given factor. Returns an error code.
int com.cartotype.Framework.zoomAt | ( | double | aZoomFactor, |
double | aX, | ||
double | aY, | ||
CoordType | aCoordType | ||
) |
Zooms by the given factor, centering the zoom at aX,aY. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.zoomIn | ( | ) |
Zooms in by a factor of 2. Returns a CartoType error code: 0 = success.
int com.cartotype.Framework.zoomOut | ( | ) |
Zooms out by a factor of 2. Returns a CartoType error code: 0 = success.
|
static |
The color black.
|
static |
The color blue.
|
static |
A constant for aValidity in navigate() indicating that the course (bearing) is valid.
|
static |
The color cyan.
|
static |
The color dark blue.
|
static |
The color dark cyan.
|
static |
The color dark gray.
|
static |
The color dark green.
|
static |
The color dark magenta.
|
static |
The color dark red.
|
static |
The color dark yellow.
|
static |
A constant for aStringMatchMethod in find() indicating an exact match, ignoring case.
|
static |
A flag for aStringMatchMethod in find() indicating that accented and unaccented characters should compare equal.
|
static |
A flag for aStringMatchMethod in find() indicating that fuzzy matching should be done.
|
static |
A constant for aStringMatchMethod in find() indicating an exact match, ignoring case.
|
static |
A flag to rotate the map to the user's heading.
|
static |
A flag to make the center of the map follow the user's location.
|
static |
A flag to set the map to a suitable zoom level for the user's speed.
|
static |
The map is centred on the user's location.
|
static |
The map is centred on the user's location and rotated to the user's heading.
|
static |
The map is centred on the user's location, rotated to the user's heading, and zoomed to a suitable level for the user's speed.
|
static |
The map is centred on the user's location and zoomed to a suitable level for the user's speed.
|
static |
The map does not follow the user's location or heading.
|
static |
A flag for aStringMatchMethod in find() indicating that fuzzy matching should be done.
|
static |
A constant for aStringMatchMethod in find() indicating a match of the string with the start of the target, ignoring case.
|
static |
The color gray.
|
static |
The color green.
|
static |
A constant for aValidity in navigate() indicating that the height is valid.
|
static |
A constant for aStringMatchMethod in find() indicating that characters that are not letters or digits whould be ignored.
|
static |
A flag for aStringMatchMethod in find() indicating that any character that is not a letter, digit or whitespace should be ignored.
|
static |
A flag for aStringMatchMethod to ignore whitespace.
|
static |
Loose matching: ignore non-alphanumerics and fold accents and case.
|
static |
The color magenta.
|
static |
The maximum number of different routes which can be calculated using route profiles and displayed simultaneously.
|
static |
A constant for aValidity in navigate() indicating that the position is valid.
|
static |
A flag for aStringMatchMethod in find() indicating a search for all strings starting with the target, ignoring case.
|
static |
A constant for aStringMatchMethod in find() indicating a match of the string with the start of the target, ignoring case.
|
static |
The color red.
|
static |
A constant for aValidity in navigate() indicating that the speed is valid.
|
static |
A constant for aValidity in navigate() indicating that the time is valid.
|
static |
The 'null color' transparent black.
|
static |
The color white.
|
static |
The color yellow.