<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Configuring Mapbox &gt; Metasys Software Pvt Ltd.</title>
	<atom:link href="https://www.metasyssoftware.com/tag/configuring-mapbox/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.metasyssoftware.com</link>
	<description>Unique People, Unique Solutions</description>
	<lastBuildDate>Fri, 07 Jun 2024 12:24:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.metasyssoftware.com/wp-content/uploads/2023/10/metasys-svg-.png</url>
	<title>Configuring Mapbox &gt; Metasys Software Pvt Ltd.</title>
	<link>https://www.metasyssoftware.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Six smart steps to configure Mapbox with ReactJS</title>
		<link>https://www.metasyssoftware.com/react/six-smart-steps-to-configure-mapbox-with-reactjs/</link>
					<comments>https://www.metasyssoftware.com/react/six-smart-steps-to-configure-mapbox-with-reactjs/#respond</comments>
		
		<dc:creator><![CDATA[meta_prasad]]></dc:creator>
		<pubDate>Wed, 13 Nov 2019 11:08:09 +0000</pubDate>
				<category><![CDATA[React]]></category>
		<category><![CDATA[React Redux]]></category>
		<category><![CDATA[Outsourcing React development]]></category>
		<category><![CDATA[React JS app]]></category>
		<category><![CDATA[Offshore React development services]]></category>
		<category><![CDATA[React JS web app]]></category>
		<category><![CDATA[Custom map]]></category>
		<category><![CDATA[Mapbox studio]]></category>
		<category><![CDATA[Reactjs]]></category>
		<category><![CDATA[Customizing Mapbox]]></category>
		<category><![CDATA[Reactnative]]></category>
		<category><![CDATA[React JS example]]></category>
		<category><![CDATA[mapbox]]></category>
		<category><![CDATA[Configuring Mapbox]]></category>
		<category><![CDATA[React customapp]]></category>
		<category><![CDATA[React JS web development company]]></category>
		<category><![CDATA[React developers]]></category>
		<category><![CDATA[React JS web development]]></category>
		<category><![CDATA[React JS]]></category>
		<category><![CDATA[React development services]]></category>
		<guid isPermaLink="false">https://www.metasyssoftware.com/?p=2880</guid>

					<description><![CDATA[<p>Mapbox provides custom maps, search and navigation. It supports many platforms. The tool is powered by programmers as well as [&#8230;]</p>
The post <a href="https://www.metasyssoftware.com/react/six-smart-steps-to-configure-mapbox-with-reactjs/">Six smart steps to configure Mapbox with ReactJS</a> appeared first on <a href="https://www.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></description>
										<content:encoded><![CDATA[<style><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start">﻿</span>#fm-blog ul li { list-style: none; }</style>
<div id="fm-blog">Mapbox provides custom maps, search and navigation. It supports many platforms. The tool is powered by programmers as well as millions of devices providing Location Data. It provides developers a platform and a toolset to build customized applications where location-based data can be used to meet a variety of business requirements.<br />
<strong>A typical scenario where Mapbox is used:</strong><br />
A service provider uses Mapbox to track locations of their assets or employees in order to provide real-time information to customers or for operational monitoring. This could be a restaurant delivery service, an international transport company or even a fleet operator in a city.<br />
<strong>Customizing Mapbox</strong><br />
One of our clients provides data services to monitor the health of agricultural farms. They wished to offer compelling data visualization of agricultural farm images along with other details. We customized mapbox to render this information on the web and mobile devices. There are SDKs available for the Web, iOS and Android.<br />
<strong>In this article, we share how we configured mapbox in React JS using custom style to add new fonts, custom icons and publish these styles.</strong>Following are the steps involved –<br />
<strong>1. Steps to generate the token number and style in Mapbox</strong></p>
<ul>
<li>a. Create an account on https://account.mapbox.com</li>
<li>b. Log in to your account</li>
<li>c. On the Dashboard look for the Default public token. This Token number can be used for configuration in the Web App. You need to remember that this token number is public and easily accessible from the developer tab.</li>
<li>d. To get the private Token click on the button &#8216;Create a Token&#8217; you will get a form. Enter the &#8216;Token name&#8217; and select the desired &#8216;Public Scope&#8217; and the &#8216;Secret Scopes’.<br />
<img fetchpriority="high" decoding="async" class="alignnone wp-image-2900 size-full" title="Access tokens " src="https://www.metasyssoftware.com/wp-content/uploads/Access-tokens-1-3.png" alt="Access tokens" width="642" height="425" /></li>
<li>e. Note: &#8211; This token will only be accessible from the specific URLs that we add while generating the Token.<br />
<img decoding="async" class="alignnone wp-image-2884 size-full" title="Create an access token" src="https://www.metasyssoftware.com/wp-content/uploads/Create-an-access-token-2.png" alt="Create an access token" width="540" height="409" /><img decoding="async" class="alignnone wp-image-2901 size-full" src="https://www.metasyssoftware.com/wp-content/uploads/Token-restrictions-3-1.png" alt="Token Restrictions" width="643" height="394" /></li>
<li>f. Now add the list of comma-separated URLs into the URL field and click on the &#8216;Create Token’. Next you will be asked to confirm with your account password.</li>
<li>g. You will find the private token at the bottom of the Token list.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2902 size-full" title="Private token" src="https://www.metasyssoftware.com/wp-content/uploads/Private-token-4-1.png" alt="Private token" width="625" height="284" /></li>
</ul>
<p><strong>2. Steps to configure React JS app with Mapbox</strong></p>
<ul>
<li>a. There are two different methods available for using the Mapbox on the web App.<br />
We describe the steps using the &#8216;npm&#8217; module bundler for installing Mapbox GL JS.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2903 size-full" title="Method selection for installing Mapbox" src="https://www.metasyssoftware.com/wp-content/uploads/Method-selection-for-installing-Mapbox-5-1.png" alt="Method selection for installing Mapbox" width="398" height="232" /></li>
<li>b. Install the &#8216;npm&#8217; package &#8211;&gt; &#8216;npm install mapbox-gl &#8211;save&#8217;</li>
<li>c. Include the GL JS CSS file</li>
<li>d. Include the CSS file in theof your HTML file
<div>
<ul>
<li>i.&lt;link href=&#8217;https://api.mapbox.com/mapbox-gl-js/v1.3.1/mapbox-gl.css&#8217; rel=&#8217;stylesheet&#8217; /&gt;</li>
</ul>
</div>
</li>
<li>e. Add the map to your Web App.
<ul>
<li>i. var mapboxgl = require(‘mapbox-gl/dist/mapbox-gl.js&#8217;);</li>
<li>ii. mapboxgl.accessToken = &#8216;Your Token number’;</li>
<li>iii. var map = new mapboxgl.Map({</li>
<li>iv. container: &#8216;YOUR_CONTAINER_ELEMENT_ID&#8217;,</li>
<li>v. style: &#8216;mapbox://styles/mapbox/streets-v11&#8217; // Default style link</li>
<li>vi. });</li>
</ul>
</li>
<li>f.  Now you are done with the configuration.</li>
</ul>
<p><strong>3. Steps to create the custom style of Mapbox</strong></p>
<ul>
<li>a.To create our custom style for the map, we need to open the Mapbox Studio,</li>
<li>b.To open the Mapbox studio, you can to go to the Dashboard and then click on the &#8216;Design in Mapbox Studio&#8217; on the right side of the Dashboard or Just click on the link here <a href="https://studio.mapbox.com/" target="_blank" rel="nofollow noopener noreferrer">https://studio.mapbox.com/</a></li>
<li>c.After opening the Mapbox studio, you can see the predefined styles you can use directly or you may choose to create a new style.<img loading="lazy" decoding="async" class="alignnone wp-image-2904 size-full" title="Mapbox styles" src="https://www.metasyssoftware.com/wp-content/uploads/Mapbox-styles-6-1.png" alt="Mapbox styles" width="642" height="342" /></li>
<li>d. To create a new style, click on the &#8216;New style&#8217; button on top of the page.</li>
<li>e. Select the desired template from the list and can change the style of the map from bottom of the dialog and then click on the customize button.<img loading="lazy" decoding="async" class="alignnone wp-image-2905 size-full" title="Templates" src="https://www.metasyssoftware.com/wp-content/uploads/Templates-7-1.png" alt="Templates" width="642" height="428" /></li>
<li>f. You can see a dashboard with different settings.</li>
<li>g. You can update the style of the country label, background, road, buildings and many more<img loading="lazy" decoding="async" class="alignnone wp-image-2890 size-full" title="Updating style " src="https://www.metasyssoftware.com/wp-content/uploads/Updating-style-8.png" alt="Updating style" width="692" height="326" /><img loading="lazy" decoding="async" class="alignnone wp-image-2891 size-full" title="icons" src="https://www.metasyssoftware.com/wp-content/uploads/icons-9.png" alt="icons" width="642" height="33" /></li>
</ul>
<p><strong>4. Steps to add a new font to the map and then publish for production</strong></p>
<ul>
<li>a. Click on the Fonts tab on the top-right corner then you can find a dialog to upload the new fonts.<img loading="lazy" decoding="async" class="alignnone wp-image-2892 size-full" title="Upload fonts " src="https://www.metasyssoftware.com/wp-content/uploads/upload-fonts-10.png" alt="Upload fonts" width="643" height="367" /></li>
<li>b. Clicking on the Upload new font, you can see a new dialog with the title &#8216;Upload fonts&#8217; here you can drag new fonts with extension &#8216;.TTF&#8217; and ‘.OTF’.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2893 size-full" title="Upload new font " src="https://www.metasyssoftware.com/wp-content/uploads/upload-new-font-11.png" alt="Upload new font" width="292" height="390" /></li>
<li>c. Once Font family is added, it can be then used in the map.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2894 size-full" title="icons" src="https://www.metasyssoftware.com/wp-content/uploads/icons-12.png" alt="icons " width="642" height="33" /></li>
</ul>
<p><strong>5. Steps to add a custom icon or an image and publish</strong></p>
<ul>
<li>a. The image we upload here will be available as an icon on the map for example Image as a custom marker.</li>
<li>b. Click on the &#8216;Images&#8217; tab in the header you can see a dialog to upload the SVG image.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2895 size-full" title="Upload svg" src="https://www.metasyssoftware.com/wp-content/uploads/upload-svg-images-13.png" alt="Upload svg" width="319" height="439" /><img loading="lazy" decoding="async" class="alignnone wp-image-2897 size-full" title="Drag and drop svg images" src="https://www.metasyssoftware.com/wp-content/uploads/drag-and-drop-svg-images-14.png" alt="Drag and drop svg images" width="643" height="411" /></li>
<li>c. To upload the SVG image, click on the &#8216;Upload SVG Icon&#8217; button, now you can see a new dialog where you can drag your SVG image.</li>
<li>d. Once you update any style, you have to publish the style to see the changes on the map.</li>
<li>e. Note: &#8211; It may take some time to get published and to reflect on the map.</li>
<li>f. It is very easy to publish the changes; you just have to click on the &#8216;Publish&#8217; button on the top-right corner of the map box studio.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2896 size-full" title="Image" src="https://www.metasyssoftware.com/wp-content/uploads/image-14.png" alt="Image" width="335" height="260" /></li>
<li>g. Now you can see a dialog with a slider where you can see the styles you added.</li>
<li>h. Here you can either ‘Publish as new’ which will replace all the styles, or, use the ‘Publish’ button to add the styles you added in your draft.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2898 size-full" title="Basic template" src="https://www.metasyssoftware.com/wp-content/uploads/basic-template-15.png" alt="Basic template" width="483" height="440" /></li>
</ul>
<p><strong>6. Steps to add the updated style to our map</strong></p>
<ul>
<li>a. Once the style is published,click on the &#8216;Share&#8217; tab on the top-right corner of the Mapbox Studio. Here you can see a dialog where you can find your &#8216;Your style Url&#8217; and &#8216;Your access token’.<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-2899 size-full" title="Share" src="https://www.metasyssoftware.com/wp-content/uploads/share-16.png" alt="Share" width="564" height="338" /></li>
<li>b. Now update your style URL of the map.
<ul>
<li>i. var map = new mapboxgl.Map({</li>
<li>ii. style: &#8216;Add your style URL Here&#8217;</li>
<li>iii. });</li>
</ul>
</li>
<li>c. Example:
<ul>
<li>i. const feature: feature = {</li>
<li>ii. id: 123,</li>
<li>iii. type: &#8216;Feature&#8217;,</li>
<li>iv. geometry: feature.geometry,</li>
<li>v. properties: {
<ul>
<li>1. meta: feature.meta,</li>
<li>2. icon: &#8216;square-stroke&#8217;</li>
<li>3. // Custom Icon name which is added to the style in Mapbox Studio</li>
</ul>
</li>
<li>vi. }</li>
<li>vii. }</li>
</ul>
</li>
</ul>
<p>We at MetaSys software have helped the clients in building such kind of custom software solutions. For more details &#8211; <a href="https://www.metasyssoftware.com/case-study-react">https://www.metasyssoftware.com/case-study-react</a></p>
</div>The post <a href="https://www.metasyssoftware.com/react/six-smart-steps-to-configure-mapbox-with-reactjs/">Six smart steps to configure Mapbox with ReactJS</a> appeared first on <a href="https://www.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.metasyssoftware.com/react/six-smart-steps-to-configure-mapbox-with-reactjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
