{"id":2800,"date":"2023-12-22T19:12:10","date_gmt":"2023-12-22T19:12:10","guid":{"rendered":"https:\/\/developers.maplink.global\/leaflet-resources\/"},"modified":"2024-03-04T14:26:30","modified_gmt":"2024-03-04T14:26:30","slug":"leaflet-resources","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/leaflet-resources\/","title":{"rendered":"Leaflet resources"},"content":{"rendered":"\n<p>To use Leaflet resources or parameters that don&#8217;t yet have equivalents in our Javascript API, you can directly access the Leaflet and its map object via the properties <code>L<\/code> and <code>map<\/code>, respectively.<\/p>\n\n<p>The example below uses Leaflet&#8217;s <code>circle<\/code> function to draw a circle:<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">const L = maplink.L;\nconst map = maplink.map;\n\n\nL.circle([51.508, -0.11], {\n    color: 'red',\n    fillColor: '#f03',\n    fillOpacity: 0.5,\n    radius: 500\n}).addTo(map);<\/pre>\n\n<p>To check all the features that Leaflet offers, consult the documentation at <a href=\"https:\/\/leafletjs.com\/\">leafletjs<\/a>. The version currently used in our API is 1.7.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To use Leaflet resources or parameters that don&#8217;t yet have equivalents in our Javascript API, you can directly access the Leaflet and its map object via the properties L and map, respectively. The example below uses Leaflet&#8217;s circle function to draw a circle: To check all the features that Leaflet offers, consult the documentation at [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[169],"tags":[],"class_list":["post-2800","post","type-post","status-publish","format-standard","hentry","category-map-display-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/comments?post=2800"}],"version-history":[{"count":1,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2800\/revisions"}],"predecessor-version":[{"id":2801,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2800\/revisions\/2801"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}