{"id":596032,"date":"2017-12-07T12:02:55","date_gmt":"2017-12-07T12:02:55","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=596032"},"modified":"2021-01-19T13:22:16","modified_gmt":"2021-01-19T13:22:16","slug":"using-custom-styles-for-maps","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/de\/course-lesson\/using-custom-styles-for-maps\/","title":{"rendered":"Using custom styles for maps"},"content":{"rendered":"\n<p class=\"alert alert-info\">Azure Maps currently do not allow using custom styles for maps.<\/p>\n\n\n\n<p>Toolset Maps allows you to easily use these custom styles when displaying maps. You can set a default map style for your site and also to select a style per map, which overwrites the default one. The following two images show examples of different styles.<\/p>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid tb-grid\" data-toolset-blocks-grid=\"9cbc03461b87a40447ddc413b8a01dd9\">\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>Map using the &#8220;Silver&#8221; custom style<\/strong><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>Map using the &#8220;Lost in the desert&#8221; custom style<\/strong><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"04b2579f107d742d8fb3578da1dfc3a5\"><div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"8e9059001c24733a3341e523a111cb6c\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-custom-styling-silver.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-custom-styling-silver-500x258.png\" alt=\"\" class=\"wp-image-960180\"\/><\/a><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"4d298e83a851213bde08aba66eced5fa\"><div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"8dd1c4b30102d9b201aea7ccf48177af\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-custom-styling-desert.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-custom-styling-desert-500x256.png\" alt=\"\" class=\"wp-image-960213\"\/><\/a><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"alert alert-info\">Toolset Maps also allows you to&nbsp;<a href=\"https:\/\/toolset.com\/documentation\/programmer-reference\/maps\/how-to-programmatically-change-map-styles\/\">set the map styles programmatically<\/a>, using custom code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a Custom Style File<\/h2>\n\n\n\n<p>To create your custom map style, or get ready-to-use ones, you can use&nbsp;<a href=\"https:\/\/mapstyle.withgoogle.com\/\">Google\u2019s Styling Wizard<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/snazzymaps.com\/\">Snazzy Maps<\/a>, for example. Details on how to use these sites is beyond the scope of this page, however, a simple online search should provide you with many tutorials. Both sites eventually present you with a generated JSON code. The following image shows how this looks like in Google\u2019s Styling Wizard.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"155cdcc959b16c6da7de8d49344fb2f2\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-creating-the-custom-styling-file.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-creating-the-custom-styling-file-500x462.png\" alt=\"\" class=\"wp-image-960216\"\/><\/a><div class=\"tb-image-caption\"><figcaption>A styling file generated using Google Styling Wizard<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>You need to copy this code and paste it into a text editor of your choice. Then, save the file with the&nbsp;<strong>.json&nbsp;<\/strong>extension, for example:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>black-and-white-map.json<\/strong><\/li><\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Changing the Default Map Style for Your Site<\/h2>\n\n\n\n<p>Go to the&nbsp;<strong>Toolset&nbsp;<\/strong>\u2192&nbsp;<strong>Settings&nbsp;<\/strong>page, click the&nbsp;<strong>Maps&nbsp;<\/strong>tab and scroll down to the&nbsp;<strong>Map styles&nbsp;<\/strong>section.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"2fc1a74b3e2d48b4c420f27ee0cd45b5\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-select-default-map-style.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/toolset-maps-select-default-map-style-500x163.png\" alt=\"\" class=\"wp-image-960219\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Map styles section of the Toolset Settings page<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Use the&nbsp;<strong>Default map style&nbsp;<\/strong>dropdown to select a style. By default, you can select from three classic Google Maps styling: Night, Silver, and Standard. Use the&nbsp;<strong>Upload a different map style (JSON file)&nbsp;<\/strong>button to upload a file created through steps explained in the previous section.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Selecting a Custom Style for Specific Maps<\/h2>\n\n\n\n<p>When inserting a map into your pages or templates, you can select the style specifically for that map. Add the&nbsp;<strong>Map<\/strong> block and in the block settings look for the&nbsp;Map style&nbsp;section. You can use the dropdown menu to select one of the available styles.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"837c137731224143b9f7ab1fcaa1425c\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/custom-map-json-style-2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/12\/custom-map-json-style-2-500x245.png\" alt=\"Selecting the custom map style\" class=\"wp-image-1677969\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Selecting the custom map style<\/figcaption><\/div><\/figure>\n<\/div>","protected":false},"author":4341,"featured_media":1665269,"template":"","related-lesson":[8423],"class_list":["post-596032","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-maps"],"_links":{"self":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/596032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":8,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/596032\/revisions"}],"predecessor-version":[{"id":1680563,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/596032\/revisions\/1680563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media\/1665269"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media?parent=596032"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/related-lesson?post=596032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}