<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fabricio F. P. Hein on Medium]]></title>
        <description><![CDATA[Stories by Fabricio F. P. Hein on Medium]]></description>
        <link>https://medium.com/@fabriciofphein?source=rss-6e9c1e110636------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*OaO9KO3-IPiKM_KU.</url>
            <title>Stories by Fabricio F. P. Hein on Medium</title>
            <link>https://medium.com/@fabriciofphein?source=rss-6e9c1e110636------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:27:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fabriciofphein/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integração com a API Leaflet Javascript para WebMapas e dados 3D OSM Buildings]]></title>
            <link>https://medium.com/@fabriciofphein/integra%C3%A7%C3%A3o-com-a-api-leaflet-javascript-para-webmapas-e-dados-3d-osm-9947e64c36fe?source=rss-6e9c1e110636------2</link>
            <guid isPermaLink="false">https://medium.com/p/9947e64c36fe</guid>
            <category><![CDATA[3d-mapping]]></category>
            <category><![CDATA[gis-web]]></category>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[cartography]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Fabricio F. P. Hein]]></dc:creator>
            <pubDate>Wed, 20 Sep 2017 01:24:32 GMT</pubDate>
            <atom:updated>2017-09-20T12:21:50.463Z</atom:updated>
            <content:encoded><![CDATA[<p>Integração com a API Leaflet Javascript para WebMapas e dados 3D OSM Buildings</p><p>Esse é o meu primeiro post no Medium, então vamos lá! Hoje quero apresentar um pouco do que aprendi a trabalhar com a Linguagem Javascript voltada a WebMapas, especificamente a bilbioteca Leaflet.</p><p>Nesse post, pretendo integrar dados 3D OSM de edificações com a API de mapas web Leaflet.</p><p>O Leaflet é uma biblioteca baseada em Javascript e totalmente open source, o é projetado com simplicidade, desempenho e usabilidade em mente. Ele funciona de forma eficiente em todas as principais plataformas de desktop e móveis epode ser ampliado com muitos plugins.</p><p>Agora vamos iniciar a nossa primeira aplicação:</p><p>Para aqueles familiarizados com o Javscript e HTML, será mamão com açucar.</p><p>Abra um bloco de nota limpo e insira o seguinte código abaixo:</p><p>Na área do &lt;head&gt; deve-se chamar o script do Leaflet e o CSS, sendo:</p><pre><strong>Estilo CSS</strong>:</pre><pre>&lt;link rel=’stylesheet prefetch’ href=’<a href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css&#39;">http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css&#39;</a>&gt;</pre><pre><strong>Leaflet Script:</strong></pre><pre>&lt;! — Leaflet API →&gt;</pre><pre>&lt;script src=’<a href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js&#39;">http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js&#39;</a>&gt;&lt;/script&gt;</pre><pre><strong>&lt;! — API 3D OSM→&gt;</strong></pre><pre>&lt;script src=’<a href="https://cdn.osmbuildings.org/OSMBuildings-Leaflet.js&#39;">https://cdn.osmbuildings.org/OSMBuildings-Leaflet.js&#39;</a>&gt;&lt;/script&gt;</pre><p>Dessa forma, definimos o estilos CSS para o Body e a variável Mapa:</p><pre>body {<br>  font-family: sans-serif;<br>  padding: 5px;<br>  margin: 0;<br>}</pre><pre>#map {<br>  width: 900px;<br>  height: 600px;<br>  float: left;<br>  margin: 0 15px 0 0;<br>}</pre><p>Para que o mapa apareça, inserimos no &lt;body&gt; a DIV que representa a variável “map”:</p><pre>&lt;div id=&quot;map&quot;&gt;&lt;/div&gt;</pre><p>Dentro da tag &lt;body&gt; inserimos o seguinte script que define a variável Map. Para que aparece no mapa a base do 3D Open Street Map e o mapa, definimos as variáveis e a chamamos para ser adicionado com o comando .add(map)</p><pre>var map = new L.Map(&#39;map&#39;).setView([ -25.4306196, -49.2699194], 17);<br><br>new L.TileLayer(&#39;https://{s}.tiles.mapbox.com/v3/osmbuildings.kbpalbpk/{z}/{x}/{y}.png&#39;, {<br>  attribution: &#39;Map tiles &amp;copy; &lt;a href=&quot;https://mapbox.com&quot;&gt;MapBox&lt;/a&gt;&#39;,<br>  maxZoom: 18,<br>  maxNativeZoom: 20<br>}).addTo(map);<br><br>var osmb = new OSMBuildings(map).load();</pre><p>Ao final, salve o arquivo na extensão MAPA.HTML e abra em seu navegador.</p><p>O código final deverá ser esse:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html &gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;title&gt;Integração com 3D OSM&lt;/title&gt;<br>  <br>  <br>&lt;link rel=&#39;stylesheet prefetch&#39; href=&#39;<a href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css&#39;">http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css&#39;</a>&gt;</pre><pre>&lt;script src=&#39;<a href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js&#39;">http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js&#39;</a>&gt;&lt;/script&gt;<br>&lt;script src=&#39;<a href="https://cdn.osmbuildings.org/OSMBuildings-Leaflet.js&#39;">https://cdn.osmbuildings.org/OSMBuildings-Leaflet.js&#39;</a>&gt;&lt;/script&gt;<br>    <br>&lt;/head&gt;<br>&lt;style&gt;<br>body {<br>  font-family: sans-serif;<br>  padding: 5px;<br>  margin: 0;<br>}</pre><pre>#map {<br>  width: 900px;<br>  height: 600px;<br>  float: left;<br>  margin: 0 15px 0 0;<br>}</pre><pre>&lt;/style&gt;<br>&lt;body&gt;<br>  &lt;div id=&quot;map&quot;&gt;&lt;/div&gt;<br> </pre><pre>&lt;script&gt;<br>var map = new L.Map(&#39;map&#39;).setView([ -25.4306196, -49.2699194], 17);</pre><pre>new L.TileLayer(&#39;<a href="https://{s}.tiles.mapbox.com/v3/osmbuildings.kbpalbpk/%7Bz%7D/%7Bx%7D/%7By%7D.png&#39;">https://{s}.tiles.mapbox.com/v3/osmbuildings.kbpalbpk/{z}/{x}/{y}.png&#39;</a>, {<br>  attribution: &#39;Map tiles &amp;copy; &lt;a href=&quot;<a href="https://mapbox.com/">https://mapbox.com</a>&quot;&gt;MapBox&lt;/a&gt;&#39;,<br>  maxZoom: 18,<br>  maxNativeZoom: 20<br>}).addTo(map);</pre><pre>var osmb = new OSMBuildings(map).load();</pre><pre>&lt;/script&gt;</pre><pre>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*Qko9kyLnVoTrCeLZM7UGKQ.png" /></figure><p>Acima o resultado esperado para a integração da bilbioteca Leaflet com os dados 3D OSM!</p><p>Espero que tenham gostado!</p><p>Abraços!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9947e64c36fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>