This commit is contained in:
Zsolt Ero
2024-01-11 20:45:30 +01:00
parent 7aa30d6584
commit abf7b9586e

View File

@@ -18,7 +18,7 @@
Include Include
<a href="https://maplibre.org/maplibre-gl-js/docs/" target="_blank">MapLibre GL JS</a> in the <a href="https://maplibre.org/maplibre-gl-js/docs/" target="_blank">MapLibre GL JS</a> in the
<code>&lt;head&gt;</code>. If you are using npm, you can install the <code>&lt;head&gt;</code>. If you are using npm, you can install the
<code>maplibre-gl</code> package, but make sure to load the CSS manually. <code>maplibre-gl</code> package. Make sure to import the CSS as well.
</p> </p>
<pre><code class="language-html">&lt;script src=&quot;https://unpkg.com/maplibre-gl/dist/maplibre-gl.js&quot;&gt;&lt;/script&gt; <pre><code class="language-html">&lt;script src=&quot;https://unpkg.com/maplibre-gl/dist/maplibre-gl.js&quot;&gt;&lt;/script&gt;
&lt;link &lt;link
@@ -26,15 +26,15 @@
rel=&quot;stylesheet&quot; rel=&quot;stylesheet&quot;
/&gt; /&gt;
</code></pre> </code></pre>
<p>And initialize it to a div, like this:</p> <p>Initialize it to a div like this:</p>
<pre><code class="language-html">&lt;div id=&quot;map&quot; style=&quot;width: 100%; height: 500px&quot;&gt;&lt;/div&gt; <pre><code class="language-html">&lt;div id=&quot;map&quot; style=&quot;width: 100%; height: 500px&quot;&gt;&lt;/div&gt;
&lt;script&gt; &lt;script&gt;
const map = new maplibregl.Map({ const map = new maplibregl.Map({
style: 'https://tiles.openfreemap.org/styles/liberty', style: 'https://tiles.openfreemap.org/styles/liberty',
center: [-0.114, 51.506], center: [-0.114, 51.506],
zoom: 14.2, zoom: 14.2,
container: 'map'; container: 'map'
}) })
&lt;/script&gt; &lt;/script&gt;
</code></pre> </code></pre>
</div> </div>