{"id":6003,"date":"2022-12-28T16:32:31","date_gmt":"2022-12-28T13:02:31","guid":{"rendered":"https:\/\/en.geobox.ir\/developers\/?post_type=docs&#038;p=6003"},"modified":"2023-01-21T09:01:19","modified_gmt":"2023-01-21T05:31:19","slug":"addmap","status":"publish","type":"docs","link":"https:\/\/en.geobox.ir\/developers\/docs\/add-sources-geobox-api-for-leaflet\/addmap\/","title":{"rendered":"Add map"},"content":{"rendered":"<p>To open a map that has already been created in geobox studio, first copy the uuid of the map from the geobox portal and <a href=\"https:\/\/en.geobox.ir\/developers\/docs\/map-geobox-api-for-javascript\/map-2\/#4-toc-title\">get the map from the server<\/a>:<\/p>\n<h3>getMap(map_uuid)<\/h3>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mapObject = await Server.getMap('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<p>Then open the map as follows.<\/p>\n<h3>addMap(mapObject, apikey)<\/h3>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mapObject is the map that is got from the server.<\/p>\n<p>apikey is described in <a href=\"https:\/\/www.geobox.ir\/doc\/v1\/%d9%85%d8%af%db%8c%d8%b1%db%8c%d8%aa-%d8%ad%d8%b3%d8%a7%d8%a8%d9%87%d8%a7-%d9%88-%d8%aa%d9%88%da%a9%d9%86%d9%87%d8%a7%db%8c-%d8%af%d8%b3%d8%aa%d8%b1%d8%b3%db%8c\/%d8%aa%d9%86%d8%b8%db%8c%d9%85%d8%a7%d8%aa-%d8%ad%d8%b3%d8%a7%d8%a8-%da%a9%d8%a7%d8%b1%d8%a8%d8%b1%db%8c\/\">manage accounts and access tokens<\/a>.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p class=\"unprose txt-m mb3 anchor mt12\">String: Returns a message that shows adding map was successful or not. Null message means adding was successful.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const result = await map.addMap(mapObject\u00a0,\"&lt;apikey here&gt;\");<\/pre>\n<p class='codepen'  data-height='500' data-theme-id='1' data-slug-hash='LYBGgGV' data-default-tab='result' data-animations='run' data-editable='' data-embed-version='2'>\nSee the Pen <a href=\"https:\/\/codepen.io\/geobox-gl-demo\/pen\/LYBGgGV\">Contact Form \u2013 Pen a Day 20<\/a> by geobox (<a href=\"https:\/\/codepen.io\/geobox-gl-demo\">@geobox-gl-demo<\/a>) on <a href=\"http:\/\/codepen.io\">CodePen<\/a>.1<\/p>\n<script async src=\"https:\/\/cpwebassets.codepen.io\/assets\/embed\/ei.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>To open a map that has already been created in geobox studio, first copy the uuid of the map from the geobox portal and get the map from the server: getMap(map_uuid) Example: const mapObject = await Server.getMap(&#8216;4f9f3e4b-4dc1-469b-83ab-00ae00f02581&#8217;); Then open the map as follows. addMap(mapObject, apikey) Parameters: mapObject is the map that is got from the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[62],"doc_tag":[],"class_list":["post-6003","docs","type-docs","status-publish","hentry","doc_category-add-sources-geobox-api-for-leaflet"],"_links":{"self":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6003","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=6003"}],"version-history":[{"count":10,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6003\/revisions"}],"predecessor-version":[{"id":6611,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6003\/revisions\/6611"}],"wp:attachment":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/media?parent=6003"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_category?post=6003"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_tag?post=6003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}