Repository navigation
Map Overlays iOS
DHollowellHPE edited this page Oct 27, 2026
·
1 revision
This article describes how to add interactive map overlays.
Map overlays are colored shapes you can draw on your maps using area placemarks. You can make these overlays interactive.
A map overlay example is included in the iOS Sample app.
Use this code to implement a map overlay.
MRPlacemark *myPlacemark; // known placemark
if (myPlacemark.area != NULL) {
// Create the MRPathOverlay
MRPathOverlay* overlay = [[MRPathOverlay alloc] initWithPlacemark:myPlacemark];
// Enables willTapOverlay() and didTapOverlay() callbacks
overlay.userInteractionEnabled = TRUE;
// Add the MRPathOverlay to the map
[mapView addOverlay:overlay];
// Set the color after it has been added to map (when the renderer is ready)
MRPathRenderer *renderer = [mapView rendererForOverlay:overlay];
if(renderer != NULL){
renderer.strokeColor = [UIColor colorWithRed:0.1333
green: 0.1333 blue:0.666 alpha:0.333];
renderer.fillColor = [UIColor colorWithRed: 0.1333
green: 0.1333 blue:0.666 alpha:0.200];
}
}