Map objects in a single layer often have different attributes. For instance, roads have a RoadType attribute giving the importance of the road, whether it is one-way, whether it has a central divider, etc. These attributes affect the way the road is drawn.

You use <condition> sections inside <layer> to treat objects with differing attributes in different ways. Each <condition> section is like an embedded <layer> section for only those objects with the specified attributes.

A <condition> section inherits all attributes defined in the containing <layer>, unless it is nested inside another condition, in which case it inherits from the containing condition. Conditions may be nested up to 15 levels deep.

You set the actual condition using a style sheet expression in the exp attribute. Expressions test integer and string attributes of map objects; if the expression is true, the object is drawn using the styles given inside the condition element

This is hard to understand without an example. Here is the road layer from a style sheet formerly used by the CartoType demo programs:

<layer name="road">
   <line width="30m" fill="orange" border="black" borderWidth="5%"/>
   <label font-size="75%,8pt"/>
   <condition exp="RoadType in [#400,#BFF]">
      <scale max="50000"/>
      <line width="18m" fill="yellow" border="black" borderWidth="5%"/>
      <label font-size="75%,8pt" maxScale="15000"/>
      <oneWayArrow path="M 0 50 H 300 L 40 300 H 180 L 505 0 L 180 -300 H 40 L 300 -50 H 0 Z" fill="teal" opacity="0.5"/>
   </condition>
   <condition exp="(RoadType bitand #FF00)==#300">
      <scale max="100000"/>
      <line width="22m,2pt" fill="orange" border="black" borderWidth="5%" centerLine="white" centerLineWidth="5%"/>
      <label font-size="75%,9pt"/>
      <oneWayArrow path="M 0 50 H 300 L 40 300 H 180 L 505 0 L 180 -300 H 40 L 300 -50 H 0 Z" fill="teal" opacity="0.5"/>
   </condition>
   <condition exp="(RoadType bitand #FF00)==#200">
      <line width="30m,2pt" fill="tomato" border="black" borderWidth="5%" centerLine="pink" centerLineWidth="5%"/>
      <label font-size="75%,10pt"/>
      <oneWayArrow path="M 0 50 H 300 L 40 300 H 180 L 505 0 L 180 -300 H 40 L 300 -50 H 0 Z" fill="yellow" opacity="0.5"/>
   </condition>
   <condition test="(RoadType bitand #FF00)==#100">
      <line width="45m,2pt" fill="mediumturquoise" border="black" borderWidth="5%" centerLine="white" centerLineWidth="5%"/>
      <label font-size="75%,10pt"/>
      <oneWayArrow path="M 0 50 H 300 L 40 300 H 180 L 505 0 L 180 -300 H 40 L 300 -50 H 0 Z" fill="yellow" opacity="0.5"/>
   </condition>
</layer>

The first condition has the test "RoadType in [#400,#BFF]", meaning that only roads with road types in the range 400 (hex) to BFF (hex) inclusive are drawn by the specifications in this condition. These are minor and unclassified roads, and are drawn by this style sheet in yellow and not drawn at smaller scales than 1:15000.

Here is an example showing the inheritance of attributes from the containing layer:

<layer name='waterway'>
<label font-style='italic' color='blue' case='assume-title' glow='white'/>
   <!-- RIVER -->
   <condition exp='(Type bitand #FFFF0000)=="riv"'>
   <line width='20m,1pt' fill='skyblue'/>
   <label font-size='75%,8pt' maxScale='1000000'/>
   </condition>
   <!-- CANAL -->
   <condition test='(Type bitand #FFFF0000)=="can"'>
   <line width='8m,1pt' fill='skyblue'/>
   <label font-size='75%,8pt' maxScale='1000000'/>
   </condition>
   <!-- STREAM -->
   <condition test='(Type bitand #FFFF0000)=="str"'>
   <line width='8m,1pt' fill='skyblue'/>
   <label font-size='75%,8pt' maxScale='250000'/>
   </condition>
   <!-- DRAIN -->
   <condition test='(Type bitand #FFFF0000)=="dra"'>
   <line width='4m,1pt' fill='skyblue'/>
   <label font-size='75%,8pt' maxScale='25000'/>
   </condition>
</layer>

And here is an example of a nested condition:

<!-- UNCLASSIFIED AND TERTIARY -->
<condition test='(RoadType bitand #F00)==#400'>
<scale max='400000'/>
<line width='25m,0.5pt' fill='ivory' border='black' borderWidth='8%,0.7,2'/>
<label font-size='70%,8pt' glow='white' color='black' case='assume-title' maxScale='20000'/>
<oneWayArrow path='#arrow' gap='2500' fill='teal' opacity='0.5' isLabel='yes'/>
<bridge width='38m,2pt' border='black' borderWidth='14%,1' endPath='l 512 512' maxScale='50000'/>
<tunnel dashArray='1,1' fill='grey' mouth='black' mouthWidth='20%,1' mouthPath='m 0 512 a 512 512 0 1 1 0 -1024'/>
   <!-- TERTIARY -->
   <condition test='(RoadType bitand #F80)==#400'>
   <line fill='khaki'/>
</condition>

Here, tertiary roads are exactly the same as unclassified roads except for their fill color, so a lot of unnecessary repetition is avoided. But note that all the nested tests must succeed for this to work. In this example, the test '(RoadType bitand #F00)==#400' selects both unclassified and tertiary roads, while '(RoadType bitand #F80)==#400' selects tertiary only. When the map is drawn, objects are matched to the innermost test that succeeds.

... 

Road types are as defined in the enumerated type CartoType::TRoadType:

 

enum TRoadType
{
/** The major road type is held in the high 8 bits. */
EMajorRoadTypeMask = 0xFF00,
 
/** The minor road type flags are held in the low 8 bits. */
EMinorRoadTypeMask = 0x00FF,
 
/** Roads of unknown type. */
EUnknownMajorRoadType = 0,
 
/** Primary road with limited access (motorway, freeway, etc.). */
EPrimaryLimitedAccessRoadType = 0x100,
 
/** Primary road without limited access: UK 'A' road. */
EPrimaryUnlimitedAccessRoadType = 0x200,
 
/** Secondary road: UK 'B' road. */
ESecondaryRoadType = 0x300,
 
/** Local road or town or city street. */
EMinorRoadType = 0x400,
 
/** Byway: road or track passable only by 4WD vehicles. */
EBywayRoadType = 0x500,
 
/** Access ramp to limited access road. */
EAccessRampType = 0x600,
 
/** Service road or access road. */
EServiceRoadType = 0x700,
 
/** Vehicular Ferry route. */
EVehicularFerryRoadType = 0x800,
 
/** Passenger-only Ferry route. */
EPassengerFerryRoadType = 0x900,
 
/** Path or walkway for pedestrians. */
EPathRoadType = 0xA00,
 
/** Stairway or escalator for pedestrians. */
EStairwayRoadType = 0xB00,
 
/** A bit flag for roads separated by a central divider. */
ESeparatedRoadTypeFlag = 1,
 
/** A bit flag for roads in a tunnel. */
ETunnelRoadTypeFlag = 2,
 
/** A bit flag for underpassing roads. */
EUnderpassRoadTypeFlag = 4,
 
/** A bit flag for roads with a central railway or tramway. */
ECentralRailLineRoadTypeFlag = 8,
 
/** A bit flag indicating that the road is one-way in the direction in which it is defined. */
EOneWayForwardRoadTypeFlag = 16,
 
/** A bit flag indicating that the road is one-way in the reverse direction to that in which it is defined. */
EOneWayBackwardRoadTypeFlag = 32,
/** A bit flag to allow access ramps (links) to be marked as sub-types of a major road type. */
ELinkRoadTypeFlag = 64,
 
/**
A bit flag to allow a distinction to be made between grades of road, within the major road type.
It allows OpenStreetMap data to distinguish trunk roads from primary roads in a backward-compatible way.
*/
ELowerGradeRoadTypeFlag = 128,
};
 

... 

CTM1 map files created from US Census Dept. TIGER data use the attribute 'CFCC', which gives the feature type. CFCC stands for Census Feature Class Code.

The original CFCC codes are made from an uppercase letter followed by a two-digit number. The codes used in CartoType's CTM1 data format are entirely numeric. The uppercase letter is replaced by one or two digits, using the range 1...26 for the letters A...Z. Thus A08 (road with rail line in center) becomes 108, and X00 (feature not yet classified) becomes 2400.

For roads, CFCC codes are translated into CartoType road types, which are explained in the previous section.

There is a list of CFCC codes at http://www.census.gov/geo/www/tiger/tigerua/ua2ktgr.pdf (in Chapter 3).

... 

CTM1 map files created from OpenStreetMap data (OSM files in XML format) use the attribute Type. This 32-bit value contains a value in its upper 15 bits that encodes a three-letter tag that is a mnemonic for one of the tags used in the OSM file. The encoding is done like this: for the purpose of explanation here is a C macro that takes three lower-case letters:

 #define OsmType(A,B,C) ((((A)-'a') << 27) | (((B)-'a') << 22) | (((C)-'a') << 17)) 

However, you don't have to work with the actual numeric values because you can use the three-letter tag on the right hand side of a test in a condition.

Here are the OpenStreetMap types that are currently defined and used by generate_map_data_type1.

EAbandoned = OsmType('a','b','a'),
EAerodrome = OsmType('a','e','r'),
EAirfield = OsmType('a','i','r'),
EAirportGate = OsmType('a','g','t'),
EAirportHoldingPosition = OsmType('a','h','p'),
EAllotments = OsmType('a','l','l'),
EAlpineHut = OsmType('a','l','p'),
EAmbulanceStation = OsmType('a','m','b'),
EApron = OsmType('a','p','r'),
EAerialWayPylon = OsmType('a','p','y'),
EArtwork = OsmType('a','r','t'),
EAerialWayStation = OsmType('a','s','t'),
EAirTerminal = OsmType('a','t','e'),
EAtm = OsmType('a','t','m'),
EAttraction = OsmType('a','t','t'),
EBabyHatch = OsmType('b','a','b'),
EBarracks = OsmType('b','a','r'),
EBasin = OsmType('b','a','s'),
EBay = OsmType('b','a','y'),
EBeach = OsmType('b','e','a'),
EBeacon = OsmType('b','e','c'),
EBedAndBreakfast = OsmType('b','e','d'),
EBench = OsmType('b','e','n'),
EBank = OsmType('b','n','k'),
EBoatyard = OsmType('b','o','a'),
EBoundary = OsmType('b','o','u'),
EBorough = OsmType('b','o','r'),
EBicycleParking = OsmType('b', 'p', 'k'),
EBicycleRental = OsmType('b', 'r', 'e'),
EBridleway = OsmType('b','r','i'),
EBrownField = OsmType('b','r','o'),
EBusStop = OsmType('b','s','p'),
EBusStation = OsmType('b','s','t'),
EBufferStop = OsmType('b','u','f'),
EBuilding = OsmType('b','u','i'),
EBunker = OsmType('b','u','n'),
ECabin = OsmType('c','a','b'),
ECafe = OsmType('c','a','f'),
ECampSite = OsmType('c','a','m'),
ECanal = OsmType('c','a','n'),
ECaveEntrance = OsmType('c','a','v'),
ECableCar = OsmType('c','c','r'),
ECableDistributionCabinet = OsmType('c','d','c'),
ECemetery = OsmType('c','e','m'),
EChairLift = OsmType('c','h','a'),
ECheckPoint = OsmType('c','h','e'),
EChalet = OsmType('c','h','l'),
ECivilBoundary = OsmType('c','i','b'),
ECinema = OsmType('c','i','n'),
ECity = OsmType('c','i','t'),
ECliff = OsmType('c','l','f'),
EClinic = OsmType('c','l','i'),
ECommercial = OsmType('c','m','r'),
ECoastline = OsmType('c','o','a'),
ECollege = OsmType('c','o','l'),
ECommon = OsmType('c','o','m'),
EConstruction = OsmType('c','n','s'),
EConservation = OsmType('c','n','v'),
EContinent = OsmType('c','o','n'),
ECounty = OsmType('c','o','u'),
ECarPark = OsmType('c','p','k'),
ECarRental = OsmType('c','r','e'),
ECrossing = OsmType('c','r','o'),
ECountry = OsmType('c','r','y'),
ECarSharing = OsmType('c','s','h'),
ECarWash = OsmType('c','w','a'),
ECaravanSite = OsmType('c','v','n'),
ECycleway = OsmType('c','y','c'),
EDam = OsmType('d','a','m'),
EDangerArea = OsmType('d','a','n'),
EDentist = OsmType('d','e','n'),
EDisused = OsmType('d','i','s'),
EDitch = OsmType('d','i','t'),
EDock = OsmType('d','o','c'),
EDrain = OsmType('d','r','a'),
EDragLift = OsmType('d','r','g'),
EDoctors = OsmType('d','r','s'),
EDistrict = OsmType('d','s','t'),
EElectricVehicleCharging = OsmType('e','v','c'),
EFarm = OsmType('f','a','r'),
EFarmYard = OsmType('f','a','y'),
EFell = OsmType('f','e','l'),
EFerryTerminal = OsmType('f','e','t'),
EFastFood = OsmType('f','f','d'),
EFireExtinguisher = OsmType('f','i','e'),
EFireFlapper = OsmType('f','i','f'),
EFireHose = OsmType('f','i','h'),
EFireStation = OsmType('f','i','s'),
EFireHydrant = OsmType('f','i','y'),
EFootpath = OsmType('f','o','o'),
EForestry = OsmType('f','o','r'),
EFuel = OsmType('f','u','e'),
EFunicular = OsmType('f','u','n'),
EGarages = OsmType('g','a','r'),
EGate = OsmType('g','a','t'),
EGarden = OsmType('g','d','n'),
EGenerator = OsmType('g','e','n'),
EGreenHouse = OsmType('g','h','o'),
EGlacier = OsmType('g','l','a'),
EGolfCourse = OsmType('g','o','l'),
EGondola = OsmType('g','o','n'),
EGoodsAerialWay = OsmType('g','o','o'),
EGrass = OsmType('g','r','a'),
EGreenField = OsmType('g','r','e'),
EGritBin = OsmType('g','r','b'),
EGraveYard = OsmType('g','r','y'),
EGuestHouse = OsmType('g','u','e'),
EHalt = OsmType('h','a','l'),
EHamlet = OsmType('h','a','m'),
EHangar = OsmType('h','a','n'),
EHeath = OsmType('h','e','a'),
EHelipad = OsmType('h','e','l'),
ERailwayHalt = OsmType('h','l','t'),
EHospital = OsmType('h','o','s'),
EHotel = OsmType('h','o','t'),
EHostel = OsmType('h','s','t'),
EIndustrial = OsmType('i','n','d'),
EInformation = OsmType('i','n','f'),
EIsland = OsmType('i','s','l'),
EIsolatedDwelling = OsmType('i','s','o'),
EKindergarten = OsmType('k','i','n'),
ELandFill = OsmType('l','a','n'),
ELand = OsmType('l','n','d'),
ELevelCrossing = OsmType('l','e','v'),
ELibrary = OsmType('l','i','b'),
ELightRail = OsmType('l','i','r'),
ELocality = OsmType('l','o','c'),
ELockGate = OsmType('l','o','k'),
EMaritimeBoundary = OsmType('m','a','b'),
EMall = OsmType('m','a','l'),
EMarsh = OsmType('m','a','r'),
EMeadow = OsmType('m','e','a'),
EMilitary = OsmType('m','i','l'),
EMixedAerialWay = OsmType('m','i','x'),
EMonorail = OsmType('m','o','n'),
EMotel = OsmType('m','o','t'),
EMinorPowerLine = OsmType('m','p','l'),
EMiniatureRailway = OsmType('m','r','y'),
EMud = OsmType('m','u','d'),
EMunicipality = OsmType('m','u','n'),
EMuseum = OsmType('m','u','s'),
ENarrowGauge = OsmType('n','a','r'),
ENatureReserve = OsmType('n','a','t'),
ENavalBase = OsmType('n','a','v'),
ENationalParkBoundary = OsmType('n','p','b'),
ENeighborhood = OsmType('n','e','i'),
ENursingHome = OsmType('n','u','r'),
EOrchard = OsmType('o','r','c'),
EPrecisionApproachPathIndicator = OsmType('p','a','p'),
EPark = OsmType('p','a','r'),
EPublicBuilding = OsmType('p','b','u'),
EPostBox = OsmType('p','b','x'),
EPeak = OsmType('p','e','a'),
EPharmacy = OsmType('p','h','a'),
EPhone = OsmType('p','h','o'),
EPicnicSite = OsmType('p','i','c'),
EParkingEntrance = OsmType('p','k','e'),
EParking = OsmType('p','k','g'),
EParkingSpace = OsmType('p','k','s'),
EPlantNursery = OsmType('p','l','a'),
EPlatform = OsmType('p','l','f'),
EPlaceOfWorship = OsmType('p','l','w'),
EPlayground = OsmType('p','l','y'),
EPoliticalBoundary = OsmType('p','o','b'),
EPostOffice = OsmType('p','o','f'),
EPolice = OsmType('p','o','l'),
EProtectedArea = OsmType('p','r','a'),
EPreservedRailway = OsmType('p','r','y'),
EPowerSubStation = OsmType('p','s','s'),
EPub = OsmType('p','u','b'),
EPowerLine = OsmType('p','w','l'),
EPowerStation = OsmType('p','w','s'),
EQuarry = OsmType('q','a','r'),
ERail = OsmType('r','a','i'),
ERange = OsmType('r','a','n'),
ERapids = OsmType('r','a','p'),
ERecycling = OsmType('r','c','y'),
ERecreationGround = OsmType('r','e','c'),
ERegion = OsmType('r','e','g'),
ERetail = OsmType('r','e','t'),
ERiver = OsmType('r','i','v'),
ERailway = OsmType('r','l','y'),
ERoundHouse = OsmType('r','o','u'),
EResidential = OsmType('r','s','d'),
ERestaurant = OsmType('r','s','t'),
EReservoir = OsmType('r','s','v'),
ERunway = OsmType('r','u','n'),
ERiverBank = OsmType('r','v','b'),
ESaltPond = OsmType('s','a','l'),
ESand = OsmType('s','a','n'),
ESchool = OsmType('s','c','h'),
EScree = OsmType('s','c','r'),
EScrub = OsmType('s','c','b'),
ESea = OsmType('s','e','a'),
EStateEmergencyServiceStation = OsmType('s','e','s'),
ESportsCenter = OsmType('s','p','o'),
ESportsPitch = OsmType('s','p','p'),
ESpring = OsmType('s','p','r'),
ESportsTrack = OsmType('s','p','t'),
EState = OsmType('s','t','a'),
ESteps = OsmType('s','t','e'),
EStadium = OsmType('s','t','m'),
ERailwayStation = OsmType('s','t','n'),
EStation = OsmType('s','t','n'), // deliberate duplicate
EStone = OsmType('s','t','o'),
EStopPosition = OsmType('s','t','p'),
EStream = OsmType('s','t','r'),
ESuburb = OsmType('s','u','b'),
ESubwayEntrance = OsmType('s','w','e'),
ESwimmingPool = OsmType('s','w','i'),
ESubway = OsmType('s','w','y'),
ETaxi = OsmType('t','a','x'),
ETheatre = OsmType('t','h','e'),
EThemePark = OsmType('t','h','p'),
EToilet = OsmType('t','o','i'),
ETown = OsmType('t','o','w'),
ETurningCircle = OsmType('t','c','i'),
ETurningPoint = OsmType('t','p','t'),
ETram = OsmType('t','r','a'),
ETree = OsmType('t','r','e'),
ETrafficSignals = OsmType('t','r','f'),
ETramStop = OsmType('t','r','s'),
ETurnTable = OsmType('t','u','r'),
ETower = OsmType('t','w','r'),
ETaxiway = OsmType('t','w','y'),
EUniversity = OsmType('u','n','i'),
EVisualApproachSlopeIndicator = OsmType('v','a','s'),
EVillageGreen = OsmType('v','i','g'),
EVillage = OsmType('v','i','l'),
EVineyard = OsmType('v','i','n'),
EViewPoint = OsmType('v','i','w'),
EVolcano = OsmType('v','o','l'),
EWater = OsmType('w','a','t'),
EWeir = OsmType('w','e','r'),
EWetland = OsmType('w','e','t'),
EWindsock = OsmType('w','i','s'),
EWood = OsmType('w','o','o'),
EZoo = OsmType('z','o','o')

... 

Release date: 7th February 2018

Previous release: 4.4, 27th July 2017

Summary of changes

The graphics acceleration system known as CartoType GL is now incorporated into the standard version of CartoType. To use it, you create a CFramework object in the normal way, loading the map, style sheet and fonts, then create a CMapRenderer object referencing your framework. You can then draw the map at, for example, thirty frames per second, in response to a timer event.

The CMapRenderer class is a C++ class. For Android there is the Java class MapRenderer, and for iOS there is the Objective C class CartoTypeMapRenderer.

Graphics acceleration is available for iOS, Android, Windows (desktop), OS X (Macintosh), and Linux. It is available on the Qt framework for Windows (desktop), OS X (Macintosh) and Linux.

Evaluation SDKs (software development kits) allow you to try out CartoType before you buy a license. You will be able to create a test application and  find out whether CartoType is the right solution for you. The evaluation SDKs have a few restrictions, including placing a watermark on every map, but provide access to the complete API (application programming interface) and all features including graphics-accelerated rendering.

The CartoType evaluation SDKs (software development kits) are provided for evaluation only, excluding any commercial use. For commercial licensing please contact us.

By clicking on any of the links on this page, or by using the SDK material or demonstration programs, or source code, however acquired, you accept the terms of the CartoType Evaluation License and you also accept that neither CartoType Ltd, nor any owners, shareholders or officers of CartoType Ltd, or any other contributors to, authors of or maintainers of the CartoType system, are liable for any damage, direct or consequential, caused by downloading, installing or using the SDK, or by any programs built using the SDK, and that the SDK is not warranted fit for any particular use and is for evaluation use only and may not be used for any commercial purpose.

To uninstall any of these SDKs, all you need to do is delete the files from your computer.

Sample Maps

To save download time, the SDKs contain only a single sample map. It is of the Isle of Wight, an island off the southern coast of England, chosen because of its good mix of features: urban, rural, and coastal. Please contact us if you need a map of any particular area for evaluation purposes.

Sample Code

The source code for most of our demonstration programs is available in public GitHub repositories in the account https://github.com/CartoType.The code for the current release is here: https://github.com/CartoType/CartoType-Public. The code is supplied under the permissive MIT license.

Release notes

The current version of the CartoType SDK is release 6.2. It was released on 15th September 2020.

The current build is 6.2.129, uploaded on 29th November 2020.

Major changes since 6.2.0

replaced deprecated Qt functions after upgrading to Qt 5.15
fixed case 3744: LoadIcon doesn't work on tiles created by TileBitmap
script to make licensed Mac SDK now works again after upgrading Xcode
added missing doc comments
--- release 6.2.11 ---
updated the Mac Maps App build script after upgrading Qt to 5.15.1
in the iOS SDK, replaced the CartoTypeRouteProfile struct with a class to make properties more easily accessible from Swift
--- release 6.2.18 ---
in the iOS SDK, fixed the large number of warnings about double-quoted include directives when using the latest Xcode
--- release 6.2.22 ---
fixed case 3746: icons clipped at tile boundaries when creating tile bitmaps
reinstated support for obsolete 'test' syntax in <condition> elements in the style sheet so that old style sheets still work
fixed case 2410: graphics acceleration doesn't support repeated patterns
--- release 6.2.37 ---
fixed use of incorrect style of rotator and window close and minimise icons for the Maps App on Windows 10
fixed case 3750: TECH router ignores turn restriction
fixed case 3751: CH router ignores turn restriction
fixed case 3754: SetLabelUpAngleInRadians() causes error
implemented case 3752: added functions for getting night mode and night mode colour to the non-C++ APIs
--- release 6.2.49 ---
fixed case 3758: incorrect envelope created by MWritableMapDataBase::InsertEnvelopeMapObject
replaced the old Android demo TestGL with a new much more capable one called CartoTypeMaps
--- release 6.2.55 ---
ClipperLib exceptions are now trapped to prevent crashes
replaced the iOS demo CartoTypeSwiftDemo with a new much more capable one very similar to the new Android demo
fixed case 3764: geocode summary of an address uses ward, community, etc., in preference to town or city
fixed case 3767: assertion when deleting restriction in creation of A-star routing data
--- release 6.2.94 ---
fixed case 3773: polygon areas no longer appear on the legend
--- release 6.2.97 ---
fixed case 3774: OSM paths are imported as footpaths but are not actually footpaths
fixed case 3770: the vehicle icon (route-vector) can't be hidden by disabling its layer
fixed case 4783: round metre and yard distances in turn instructions
ctm1_info wrongly displayed a supposed CartoType version number for old CTM1 files
ctm1_info now inserts commas into numbers and handles singulars and plurals
navigation data is now loaded asynchronously by LoadNavigationData
improved Android rotation gesture recogniser: minimum rotation is now ten degrees, and rotation is from first touch position
--- release 6.2.129 ---

The Android SDK

The Android SDK allows you to use CartoType with the Android operating system. You use the CartoType Android API, which gives you access to all the features of CartoType: loading maps, adding your own objects to the map, panning, zooming, address searching, routing and navigation.

Download link: Android SDK

The SDK is a ZIP file of about 22Mb. It contains a folder called cartotype_android_sdk_evaluation containing the following folders:

libs: an .AAR (Android archive) called cartotype.aar, which is the CartoType library. Add it to your Android Studio project as a dependency.

font: standard fonts; for simple CartoType use you need load only DejaVuSans.ttf

map: sample maps

style: the standard style sheets; you should load standard.ctstyle with the sample map

doc: licenses and acknowledgments for third-party libraries

Android demo program with source code

CartoTypeMaps is a full-featured sample program for CartoType on Android. It's provided as an Android Studio project, and includes the handling of user gestures for panning, zooming and rotation, routing using different profiles, turn by turn navigation, finding placenames and addresses, night mode, and perspective mode. You can set the start or end of a route using a long press. Other features are available from the menus. CartoTypeMaps is ready to run. Just download the code or use git to clone the repository (git clone https://github.com/CartoType/CartoType-Public.git). Then load the project src/demo/android_demo/CartoTypeMaps into Android Studio, connect an Android device or simulator, and select Run 'app' from the Run menu.

You can also download a prebuilt version: CartoTypeMaps as an APK file (235Mb download). You can install it on your Android phone or tablet. It comes with a map of London and the surrounding area. You can easily load other maps if you prefer.

The iOS SDK

The iOS SDK allows you to build CartoType apps for the iPhone and iPad. It is supplied as a .dmg file (Apple Disk Image) containing the file CartoType.framework. You use the CartoType iOS API, written in Objective C, which gives you access to all functionality.

Note: in order to avoid linker errors when using the -ObjC flag, you need to have at least one ".cpp" (C++) or ".mm" (Objective C++) source file in your own project, even if it's an empty one. If your project has ".m" (Objective C) and ".h" files only you will get linker errors because Xcode won't know that there is both C++ and Objective C code in the project.

Download link: iOS SDK

This is a 236Mb download containing the header files and compiled libraries for the simulator and device targets as a .dmg file. A sample map, style sheets, fonts and tools including makemap, the map building program, are also included. The download is large because it is a fat binary, containing versions of the libraries for different platforms and processors, and it is compiled using bitcode, which is now necessary for creating releasable iOS apps.

(If you are upgrading to a new version of the CartoType iOS SDK, you may sometimes find that Xcode does not recognize new Objective C headers or classes. You can usually fix this problem by closing your project, opening the organizer from the Xcode Window menu, select your project, then click on 'delete' opposite 'derived data'. Then close Xcode, reopen your project, clean it and rebuild. Thanks to TigerCoding for this tip from StackOverflow.)

iOS demo program with source code

You can also download the source code and project files for a full-featured sample app with fast hardware-accelerated rendering, handling of user gestures for panning, zooming and rotation, routing using different profiles, turn by turn navigation, finding placenames and addresses, night mode, and perspective mode. You can set the start or end of a route using a long press. Other features are available from toolbar buttons.

iOS sample project

To build and run the app, open the project in Xcode on a Macintosh and add the CartoType iOS SDK to it. If you are a licensee you can use your licensed CartoType SDK instead of the evaluation version; change the call to the license() function in AppDelegate.swift so that it supplies your license key. You will need to sign the app using your Apple developer certificate.

You can then run it in the simulator or on an iOS device.

The C# (.NET) SDK

This SDK allows you to use CartoType with the .NET framework. You can use any .NET language, such as C#, VB.NET or C++/CLI. You can build a complete application using CartoType in just a few lines of code, as shown in the C# demo program included with the SDK. The .NET SDK (documented here) gives you access to all CartoType features, including map, style sheet and font loading, route calculation, navigation and address searching. It also gives access to graphics acceleration using OpenGL ES 2.0.

Download link: .NET SDK

This is a 41Mb zipped file containing a .NET DLL built for the Intel x64 platform and a C# demonstration program that uses the CartoType DLL, with its source code and data files. An XML documentation file is also supplied. As long as it is kept in the same place as the DLL it will provide tool-tip help for some of the functions.

Note: if you have trouble adding the DLL to your project, in particular if you get a message starting "could not load file or assembly ... CartoTypeWrapper.DLL", please try the following fixes: (i) right-click on CartoTypeWrapper.dll in Windows Explorer and click on 'Properties' in the context menu, then, if you see the text 'This file came from another computer and might be blocked to help protect this computer', click 'Unblock' to the right of that text; (ii) if that doesn't work try installing, or re-installing, the Visual C++ Redistributable for Visual Studio 2017 (please google that phrase to find the current download link).

 

cartotype dot net development screen shot

The zip file creates a single directory called CartoTypeDemo when unzipped.

Useful locations

The CartoType .NET DLL

  • release version: CartoTypeDemo\vs2019\bin\x64\Release\CartoTypeWrapper.dll
  • debug version: CartoTypeDemo\vs2019\bin\x64\Debug\CartoTypeWrapper.dll

Visual Studio solution and project files:

  • CartoTypeDemo\vs2019\CartoTypeDemo.sln
  • CartoTypeDemo\vs2019\CartoTypeDemo.csproj

Data files

  • sample map: map\isle_of_wight.ctm1
  • standard style sheet: style\standard.ctstyle
  • standard font: font\DejaVuSans.ttf

The DLLs used for graphics acceleration, libEGL.dll and libGLESvs.dll, are in the same locations as the .NET DLLs. They need to be accessible to any application using the CartoType .NET SDK.

Another style sheet and extra fonts are also to be found in the style and font folders. It's always a good idea to load DroidSansFallback as well as any other fonts, because it provides characters for many non-Latin scripts.

The CartoType .NET DLL will not run on non-Intel platforms because the CartoType library is compiled into native code from C++.

The Windows SDK

This SDK (documented here) supports CartoType development for desktop versions of Windows from Windows XP through Windows 8.
The CartoType Windows SDK supports development using standard Windows, or using the Qt framework.

Download link: Windows SDK

This is a 176Mb zipped file containing the CartoType header files and debug and release mode libraries for desktop Windows, built using Microsoft Visual Studio 2015 for both the Win32 and x64 platforms.

The zip file creates a single directory called CartoType when unzipped.

Useful locations

Libraries and executables

  • release version: CartoType\bin\16.0\x64\Release\cartotype.lib
  • debug version: CartoType\bin\16.0\x64\Debug\cartotype.lib
  • tools to build maps, etc. (makemap, ctm1_info, encrypt_file): CartoType\bin\16.0\x64\Release

There are also directories with the same names but with DLL appended: CartoType\bin\16.0\x64\ReleaseDLL, etc. They contain libraries linked to the C++ runtime library as a DLL, not statically. These libraries can be used with Qt. To build for Qt you will also need to link to CartoTypeQtMapRenderer.lib, which is also supplied. Qt is supported for the x64 builds only. See CartoType and Qt for detailed instructions on using Qt to build and run the sample Maps App.

Headers

  • CartoType\src\main\base; you need include only one header file, cartotype_framework.h, to use the CartoType C++ API

Visual Studio solution and project files for the demonstration program

  • CartoType\src\demo\windows_demo\vs2019\CartoTypeDemo.sln

Data files

  • sample map: CartoType\map\isle_of_wight.ctm1
  • standard style sheet: CartoType\style\standard.ctstyle
  • standard font: CartoType\font\DejaVuSans.ttf

Another style sheet and extra fonts are also to be found in the style and font folders.

The Linux SDK

The C++ SDK (documented here) supports development for Linux (Ubuntu and other x11 versions) on 64-bit Intel platforms.
The Linux SDK supports developments using various GUI frameworks including Qt.

Download link: Linux SDK

This is a 20Mb zip file containing a folder called cartotype-linux-sdk, which contains the following folders:

bin: the release-mode evaluation CartoType library, and the makemap tool for creating maps, and the other tools ctm1_info and encrypt_file, and (for Qt builds) the Qt map graphics-accelerated map renderer library libCartoTypeQtMapRenderer.a and other libraries needed for Qt builds.

font: standard fonts; for simple CartoType use you need load only DejaVuSans.ttf

header: the C++ header files; you need to include only one of the header files, cartotype_framework.h, to use CartoType

map: a sample map

style: the standard style sheets; you should load standard.ctstyle with the sample map

Linux SDK notes

  • The CartoType Linux library is built for 64-bit Intel platforms.
  • You may need to add the option -pthread to both compiler and linker options, otherwise you might get a linker error for pthread_create.
  • Set the compiler option +std=c++14, because CartoType uses C++14.
  • If you get linker errors mentioning types in the std namespace, the cause is probably that the CartoType Linux Library is compiled using GCC 5.1 or later, and you are using GCC 4.9 or earlier.
G:\CartoType-6-0\src\main\graphics\cartotype_opengl_es_render.cpp

CartoType demonstration applications

These programs are intended to show off the features of CartoType and help you decide whether the CartoType library could be a useful part of your software application.

By using the CartoType demonstration programs, maps or style sheets, however acquired, you accept the terms of the CartoType Evaluation License and you also accept that neither CartoType Ltd, nor any owners, shareholders or officers of CartoType Ltd, or any other contributors to, authors of or maintainers of the CartoType system, are liable for any damage, direct or consequential, caused by downloading, installing or using the demonstration programs, maps or style sheets, and that the demonstration programs, maps or style sheets are not warranted fit for any particular use and are for evaluation use only and may not be used for any commercial purpose.

...