{"id":6378,"date":"2023-01-10T11:58:10","date_gmt":"2023-01-10T08:28:10","guid":{"rendered":"https:\/\/en.geobox.ir\/developers\/?post_type=docs&#038;p=6378"},"modified":"2023-01-19T16:34:52","modified_gmt":"2023-01-19T13:04:52","slug":"map-3","status":"publish","type":"docs","link":"https:\/\/en.geobox.ir\/developers\/docs\/map-geobox-api-for-leaflet\/map-3\/","title":{"rendered":"Map"},"content":{"rendered":"<p>After accessing the <a href=\"https:\/\/en.geobox.ir\/developers\/docs\/geobox-api-for-leaflet\/quick-installation-2\/\">GL<\/a> object, use the map class as follows to create a new map object:<\/p>\n<h3>map(mapElement, errCallback, addLayersControl)<\/h3>\n<div class=\"main-instructions\"><\/div>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mapElement is the ID of an HTML element that the map will be rendered in.<\/p>\n<p>errCallback is a function for error management.<\/p>\n<p>addLayersControl (Boolean)?: If false, layers control is off. default value is true.<\/p>\n<p><strong>Returns:<\/strong><\/p>\n<p><a href=\"https:\/\/www.geobox.ir\/\">map<\/a>: Returns map object to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const server = new Geobox.Server({origin:'https:\/\/api.geobox.ir'}); \r\nserver.accessToken = \"&lt;your access token here&gt;\"; \r\nconst map = new GL.Map('map', null, true);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After accessing the GL object, use the map class as follows to create a new map object: map(mapElement, errCallback, addLayersControl) Parameters: mapElement is the ID of an HTML element that the map will be rendered in. errCallback is a function for error management. addLayersControl (Boolean)?: If false, layers control is off. default value is true. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[75],"doc_tag":[],"class_list":["post-6378","docs","type-docs","status-publish","hentry","doc_category-map-geobox-api-for-leaflet"],"_links":{"self":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/comments?post=6378"}],"version-history":[{"count":10,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6378\/revisions"}],"predecessor-version":[{"id":6604,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6378\/revisions\/6604"}],"wp:attachment":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/media?parent=6378"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_category?post=6378"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_tag?post=6378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}