As web development and search continues to expand and include more rich media, implementing Schema.org markup on your website is becoming more important everyday. Implementing Schema.org code allows search engines (Google, Bing, and Yahoo) the ability to identify and use the content on your website to expand your search results with rich snippets.
One of the most important factors in search, especially if you are a local business, is to show up properly in Google Maps and have the correct location listed. The best way to do that using Schema is to properly markup your Google Map URL and other business information.
Currently, there are two (2) different ways to implement Map Schema on your website.
Example 1: Using URL Schema
Simply add the URL to your map using the hasMap property.
Microdata Example Code Snippet
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="name">Example Company Name</span>
<!-- Place the Map code in the Places (LocalBusiness) section, not PostalAddress -->
<a itemprop="hasMap" href="https://maps.google.com/maps?cid=YOURCIDNUMBER">View Map</a>
</div>
JSON-LD Example Code Snippet
<script type='application/ld+json'>{
"@context": "http://www.schema.org",
"@type": "LocalBusiness",
"name": "Example Company Name",
"hasMap": "https://maps.google.com/maps?cid=YOURCIDNUMBER"
}
}</script>
Previous Version Note: The previous Schema.org format for map URLs was using itemprop=”maps” and a lot of people today still use this old format (or haven’t updated it since they first did it). According to Schema.org, hasMap supercedes maps.
Developer Note: Here’s a free tool that let’s you find your Google Maps CID number.
Example 2: Using Expanded Map Schema
In 2014, Google announced changes to the map protocols on Schema.org. They added the new “hasMap” property which now supersedes the previous “map” property. They also added the “mapType” property which allows you to specify the type of map you are linking to. More on the mapType property below.
Microdata Example Code Snippet
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="name">Example Company Name</span>
<!-- Place the Map code in the Places (LocalBusiness) section, not PostalAddress -->
<span itemscope itemprop="hasMap" itemtype="http://schema.org/Map">
<link itemprop="mapType" href="http://schema.org/VenueMap" />
<a itemprop="url" href="http://yourvenuemapsurl.com" target="_blank">View Map</a>
</span>
</div>
JSON-LD Example Code Snippet
<script type='application/ld+json'>{
"@context": "http://www.schema.org",
"@type": "LocalBusiness",
"name": "Example Company Name",
"hasMap": {
"@type": "Map",
"mapType": "VenueMap",
"url": "http://yourvenuemapsurl.com"
}
}
}</script>
hasMap Schema: MapCategoryType
Currently, there are four different types of category types available to markup your map URL with mapType Schema. The choices are ParkingMap (for a parking map), SeatingMap (for a seating map), TransitMap (for a transit map), and VenueMap (for a venue map: malls, auditoriums, museums, etc.). For more information and possible additions to this Schema markup, visit the official Schema hasMap and MapCategoryType pages.
Related Resources:
Ryan Bradley
Latest posts by Ryan Bradley (see all)
- Desktop vs Mobile Search Results on Google - December 10, 2021
- How to Add Facebook Comments on WordPress Without Using A Plugin - September 26, 2020
- How to Implement HowTo Schema - May 14, 2020
I have researched a lot about how to add hasMap on my website and I have found your post describes it the best, thank you.
When using JSON-LD schema format, everything I have read says to use the CID method as per your guide eg:
“hasMap”: “https://www.google.com/maps?cid=YOURPLACEID”,
However, I have been looking at schema examples and have also come across:
“hasMap”: “https://www.google.com/maps/search/?api=1&query=101STREETADDRESS,CITY,STATE,ZIP&query_place_id=PLACEID”,
Any thoughts on the benefits of this alternative method?
Both can be correct. It’s typically best practice to use the canonical version of a URL so I like to use the format listed in this post but Google will not punish you for using a different one. You technically don’t even have to put a Google Map URL there, it can be the URL of any map service.
Hi Ryan, I’ve got a curley one for you. A tourist organization that is essentially a transit map (i.e. its a wine trail through the South Island of New Zealand called the Classic New Zealand Wine Trail. They are wanting the route on Google Maps to show in the SERP like this one: https://www.google.com/search?q=thermal+explorer+highway&oq=thermal+explorer+highway.
How would you recommend adding transit map schema to the website to pull this off?
You’ll have to use the Google Maps API to create it but then you’d label it in Schema as a transit map.