This [[Obsidian Web Clipper]] template is able to save from [[Google Maps]] to my personal [[Obsidian]] vault using the adequate format for my [[Using Obsidian as a Personal Atlas|personal atlas]]. It is heavily inspired on the one from the [Obsidian Web Clipper templates repository](https://github.com/kepano/clipper-templates).
## The [[macOS]] version
```json
{
"schemaVersion": "0.1.0",
"name": "Google Maps",
"behavior": "create",
"noteContentFormat": "## Location\n```base\nfilters:\n and:\n - file.basename == this.file.basename\nformulas:\n color: if(visited, \"orange\", \"green\")\n marker: '\"map-pin\"'\nviews:\n - type: map\n name: Map\n order:\n - file.name\n - formula.color\n - formula.marker\n center: note.coordinates\n coordinates: note.coordinates\n defaultZoom: 13\n markerColor: formula.color\n markerIcon: formula.marker\n```",
"properties": [
{
"name": "type",
"value": "place",
"type": "multitext"
},
{
"name": "placetype",
"value": "",
"type": "text"
},
{
"name": "visited",
"value": "",
"type": "checkbox"
},
{
"name": "address",
"value": "{{selector:button[aria-label^=\\\"Address:\\\"]?aria-label|split:\\\"Address: \\\"|slice:1|join}}",
"type": "text"
},
{
"name": "where",
"value": "{{selector:button[data-item-id=\\\"address\\\"]?aria-label|replace:\\\"/Address: /\\\":\\\"\\\"|split:\\\",\\\"|last|replace:\\\"/\\d{5}\\s*/\\\":\\\"\\\"|trim|wikilink}}",
"type": "text"
},
{
"name": "url",
"value": "{{selector:a[data-item-id=\\\"authority\\\"]?href}}",
"type": "text"
},
{
"name": "phone",
"value": "",
"type": "text"
},
{
"name": "apple_maps_url",
"value": "",
"type": "text"
},
{
"name": "gmaps_url",
"value": "{{url}}",
"type": "text"
},
{
"name": "coordinates",
"value": "{{url|split:\\\"\\!3d\\\"|last|split:\\\"\\!4d\\\"|first}},{{url|split:\\\"\\!4d\\\"|last|split:\\\"\\!\\\"|first}}",
"type": "multitext"
},
{
"name": "rating",
"value": "",
"type": "number"
},
{
"name": "place_for",
"value": "",
"type": "text"
},
{
"name": "tags",
"value": "to-review",
"type": "multitext"
}
],
"triggers": [
"https://www.google.com/maps/place/"
],
"noteNameFormat": "{{selector:div[role=\"main\"]?aria-label}}",
"path": "Personal Atlas"
}
```
## The [[iOS]] version
```json
{
"schemaVersion": "0.1.0",
"name": "Google Maps for iOS",
"behavior": "create",
"noteContentFormat": "## Location\n```base\nfilters:\n and:\n - file.basename == this.file.basename\nformulas:\n color: if(visited, \"orange\", \"green\")\n marker: '\"map-pin\"'\nviews:\n - type: map\n name: Map\n order:\n - file.name\n - formula.color\n - formula.marker\n center: note.coordinates\n coordinates: note.coordinates\n defaultZoom: 13\n markerColor: formula.color\n markerIcon: formula.marker\n```",
"properties": [
{
"name": "type",
"value": "place",
"type": "multitext"
},
{
"name": "placetype",
"value": "",
"type": "text"
},
{
"name": "visited",
"value": "",
"type": "checkbox"
},
{
"name": "address",
"value": "{{meta:name:Description|replace:\\\"/\\. (?=[A-Z])/g\\\":\\\"@@\\\"|split:\\\"@@\\\"|last|replace:\\\"/\\.$/\\\":\\\"\\\"|split:\\\", \\\"|slice:1|join:\\\", \\\"|trim}}",
"type": "text"
},
{
"name": "where",
"value": "{{selector:button[data-item-id=\\\"address\\\"]?aria-label|replace:\\\"/Address: /\\\":\\\"\\\"|split:\\\",\\\"|last|replace:\\\"/\\d{5}\\s*/\\\":\\\"\\\"|trim|wikilink}}",
"type": "text"
},
{
"name": "url",
"value": "{{selector:a[data-item-id=\\\"authority\\\"]?href}}",
"type": "text"
},
{
"name": "phone",
"value": "",
"type": "text"
},
{
"name": "apple_maps_url",
"value": "",
"type": "text"
},
{
"name": "gmaps_url",
"value": "{{url}}",
"type": "text"
},
{
"name": "coordinates",
"value": "{{url|split:\\\"\\!3d\\\"|last|split:\\\"\\!4d\\\"|first}},{{url|split:\\\"\\!4d\\\"|last|split:\\\"\\!\\\"|first}}",
"type": "multitext"
},
{
"name": "rating",
"value": "",
"type": "number"
},
{
"name": "place_for",
"value": "",
"type": "text"
},
{
"name": "tags",
"value": "to-review",
"type": "multitext"
}
],
"triggers": [
"https://www.google.com/maps/place/"
],
"noteNameFormat": "{{selector:div[role=\"main\"]?aria-label}}",
"path": "Personal Atlas"
}
```