When I want to see just the photos from one album on a map, there are two ways:
- Select the photos in the album and export them two a different Photos Library. Then you can open the new library with the selected photos and use the Places map to browse the photos on a more detailed map.
- Or run an Apple Script to show the selected photos in the maps app. Then we do not need to create a separate library. Just select all photos in the album and run this script:
use framework "MapKit"
use framework "CoreLocation"
use framework "Foundation"
use scripting additions
set shouldShowTraffic to false
set mapTypeIndicator to 1
tell application "Photos"
activate
try
set theseMediaItems to get the selection
if theseMediaItems is {} then error "No photos are selected."
set mediaItemsMetadata to {}
repeat with i from 1 to the count of theseMediaItems
set thisMediaItem to item i of theseMediaItems
set thisLocation to the location of thisMediaItem
if thisLocation is not {missing value, missing value} then
set thisTitle to the name of thisMediaItem
if thisTitle is missing value then
set thisTitle to filename of thisMediaItem
end if
set thisID to the id of thisMediaItem
set thisURL to ("photos://" & thisID)
set the end of mediaItemsMetadata to {thisTitle, thisLocation, thisURL}
end if
end repeat
if mediaItemsMetadata is {} then error "None of the selected images contain location data."
on error errorMessage number errorNumber
if errorNumber is not -128 then
display alert "ERROR" message errorMessage buttons {"Cancel"} default button 1
end if
error number -128
end try
end tell
tell application "Maps"
try
set theseMapItems to {}
repeat with i from 1 to the count of mediaItemsMetadata
set thisMetadata to item i of mediaItemsMetadata
copy thisMetadata to {thisMediaItemTitle, thisLatitudeLongitudePair, thisMediaItemURL}
copy thisLatitudeLongitudePair to {thisLatitude, thisLongitude}
-- create a coordinate
set aCoordinate to {latitude:thisLatitude, longitude:thisLongitude}
-- create an address book dictionary
set aAddressBookDictionary to (current application's NSDictionary's dictionaryWithObjects:{"Otto", "Automator"} forKeys:{"kABPersonFirstNameProperty", "kABPersonLastNameProperty"})
-- create a placemark using the coordinate and address dictionary
set aPlacemark to (current application's MKPlacemark's alloc()'s initWithCoordinate:aCoordinate addressDictionary:aAddressBookDictionary)
-- create a map item using the placemark
set aMapItem to (current application's MKMapItem's alloc()'s initWithPlacemark:aPlacemark)
set aMapItem's |name| to thisMediaItemTitle
set aURL to (current application's NSURL's URLWithString:thisMediaItemURL)
set aMapItem's URL to aURL
-- set aMapItem's |phoneNumber| to "555-555-5555"
-- add the new map item to the list of map items
set the end of theseMapItems to aMapItem
end repeat
-- create a dictionary of the map settings
set mapOptionsDict to current application's NSDictionary's dictionaryWithObjects:{shouldShowTraffic, mapTypeIndicator} forKeys:{"MKLaunchOptionsShowsTraffic", "MKLaunchOptionsMapType"}
-- display the location in the Maps application
current application's MKMapItem's openMapsWithItems:theseMapItems launchOptions:mapOptionsDict
on error errorMessage number errorNumber
if errorNumber is not -128 then
display alert "ERROR" message errorMessage buttons {"Cancel"} default button 1
end if
error number -128
end try
end tell
After running this script, you will be seeing the titles of the photos as places markers in Maps, and can zoom the view as you like, from a pole to pole view of the globe to a detailed city map, or even a satellite view of a hiking trip.
For example:
