<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Openlayers_amb_ReactJS</id>
	<title>Openlayers amb ReactJS - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Openlayers_amb_ReactJS"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;action=history"/>
	<updated>2026-08-30T09:22:29Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;diff=299006&amp;oldid=prev</id>
		<title>Joan: /* Exemple 2 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;diff=299006&amp;oldid=prev"/>
		<updated>2022-04-28T15:36:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exemple 2&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;amp;diff=299006&amp;amp;oldid=299005&quot;&gt;Mostra els canvis&lt;/a&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;diff=299005&amp;oldid=prev</id>
		<title>Joan: /* Exemple 2 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;diff=299005&amp;oldid=prev"/>
		<updated>2022-04-28T15:33:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exemple 2&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ca&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versió més antiga&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisió del 15:33, 28 abr 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l15&quot; &gt;Línia 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*react-scripts: 1.1.4&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*react-scripts: 1.1.4&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ npm install&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ npm install &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(hem d'haver creat prèviament el ''package.json'' que hi ha en el projecte)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ npm install ol --save&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ npm install ol --save&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ npm install react --save&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ npm install react --save&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l319&quot; &gt;Línia 319:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 319:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Exemple 3: react-openlayers==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Exemple 3: react-openlayers==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*https://www.npmjs.com/package/react-openlayers&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*https://www.npmjs.com/package/react-openlayers&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;diff=259204&amp;oldid=prev</id>
		<title>Joan: /* Exemple 1 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Openlayers_amb_ReactJS&amp;diff=259204&amp;oldid=prev"/>
		<updated>2020-04-09T20:35:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exemple 1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Exemples que funcionen=&lt;br /&gt;
==Exemple 1==&lt;br /&gt;
url original:&lt;br /&gt;
*https://dominoc925.blogspot.com/2019/10/simple-example-of-reactjs-and.html&lt;br /&gt;
explicació a la wiki:&lt;br /&gt;
*[[Aplicació_Reactjs_a_través_del_servidor_web_Express]]&lt;br /&gt;
&lt;br /&gt;
==Exemple 2==&lt;br /&gt;
*https://codesandbox.io/s/43p10r6w94?file=/src/index.js:0-198&lt;br /&gt;
&lt;br /&gt;
Dependències:&lt;br /&gt;
*ol: 4.6.5&lt;br /&gt;
*react: 16.3.2&lt;br /&gt;
*react-dom: 16.3.2&lt;br /&gt;
*react-scripts: 1.1.4&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ npm install&lt;br /&gt;
$ npm install ol --save&lt;br /&gt;
$ npm install react --save&lt;br /&gt;
$ npm install react-dom --save&lt;br /&gt;
$ npm install react-scripts --save&lt;br /&gt;
&lt;br /&gt;
$ npm start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''src/index.js''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import React from &amp;quot;react&amp;quot;;&lt;br /&gt;
import { render } from &amp;quot;react-dom&amp;quot;;&lt;br /&gt;
import MyMap from &amp;quot;./MyMap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
const App = () =&amp;gt; (&lt;br /&gt;
  &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;MyMap /&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
render(&amp;lt;App /&amp;gt;, document.getElementById(&amp;quot;root&amp;quot;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''src/MyMap.js'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import React, { Component } from &amp;quot;react&amp;quot;;&lt;br /&gt;
import OlMap from &amp;quot;ol/map&amp;quot;;&lt;br /&gt;
import OlView from &amp;quot;ol/view&amp;quot;;&lt;br /&gt;
import OlLayerTile from &amp;quot;ol/layer/tile&amp;quot;;&lt;br /&gt;
import OlSourceOSM from &amp;quot;ol/source/osm&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
class PublicMap extends Component {&lt;br /&gt;
  constructor(props) {&lt;br /&gt;
    super(props);&lt;br /&gt;
&lt;br /&gt;
    this.state = { center: [0, 0], zoom: 1 };&lt;br /&gt;
&lt;br /&gt;
    this.olmap = new OlMap({&lt;br /&gt;
      target: null,&lt;br /&gt;
      layers: [&lt;br /&gt;
        new OlLayerTile({&lt;br /&gt;
          source: new OlSourceOSM()&lt;br /&gt;
        })&lt;br /&gt;
      ],&lt;br /&gt;
      view: new OlView({&lt;br /&gt;
        center: this.state.center,&lt;br /&gt;
        zoom: this.state.zoom&lt;br /&gt;
      })&lt;br /&gt;
    });&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  updateMap() {&lt;br /&gt;
    this.olmap.getView().setCenter(this.state.center);&lt;br /&gt;
    this.olmap.getView().setZoom(this.state.zoom);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  componentDidMount() {&lt;br /&gt;
    this.olmap.setTarget(&amp;quot;map&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // Listen to map changes&lt;br /&gt;
    this.olmap.on(&amp;quot;moveend&amp;quot;, () =&amp;gt; {&lt;br /&gt;
      let center = this.olmap.getView().getCenter();&lt;br /&gt;
      let zoom = this.olmap.getView().getZoom();&lt;br /&gt;
      this.setState({ center, zoom });&lt;br /&gt;
    });&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  shouldComponentUpdate(nextProps, nextState) {&lt;br /&gt;
    let center = this.olmap.getView().getCenter();&lt;br /&gt;
    let zoom = this.olmap.getView().getZoom();&lt;br /&gt;
    if (center === nextState.center &amp;amp;&amp;amp; zoom === nextState.zoom) return false;&lt;br /&gt;
    return true;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  userAction() {&lt;br /&gt;
    this.setState({ center: [546000, 6868000], zoom: 5 });&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  render() {&lt;br /&gt;
    this.updateMap(); // Update map on render?&lt;br /&gt;
    return (&lt;br /&gt;
      &amp;lt;div id=&amp;quot;map&amp;quot; style={{ width: &amp;quot;100%&amp;quot;, height: &amp;quot;360px&amp;quot; }}&amp;gt;&lt;br /&gt;
        &amp;lt;button onClick={e =&amp;gt; this.userAction(&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, shrink-to-fit=no&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#000000&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      manifest.json provides metadata used when your web app is added to the&lt;br /&gt;
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;manifest&amp;quot; href=&amp;quot;%PUBLIC_URL%/manifest.json&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      Notice the use of %PUBLIC_URL% in the tags above.&lt;br /&gt;
      It will be replaced with the URL of the `public` folder during the build.&lt;br /&gt;
      Only files inside the `public` folder ca&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, shrink-to-fit=no&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#000000&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      manifest.json provides metadata used when your web app is added to the&lt;br /&gt;
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;manifest&amp;quot; href=&amp;quot;%PUBLIC_URL%/manifest.json&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      Notice the use of %PUBLIC_URL% in the tags above.&lt;br /&gt;
      It will be replaced with the URL of the `public` folder during the build.&lt;br /&gt;
      Only files inside the `public` folder can be referenced from the HTML.&lt;br /&gt;
&lt;br /&gt;
      Unlike &amp;quot;/favicon.ico&amp;quot; or &amp;quot;favicon.ico&amp;quot;, &amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot; will&lt;br /&gt;
      work correctly both with client-side routing and a non-root public URL.&lt;br /&gt;
      Learn how to configure a non-root public URL by running `npm run build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;React App&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;noscript&amp;gt;&lt;br /&gt;
		You need to enable JavaScript to run this app.&lt;br /&gt;
	&amp;lt;/noscript&amp;gt;&lt;br /&gt;
	&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      This HTML file is a template.&lt;br /&gt;
      If you open it directly in the browser, you will see an empty page.&lt;br /&gt;
&lt;br /&gt;
      You can add webfonts, meta tags, or analytics to this file.&lt;br /&gt;
      The build step will place the bundled scripts into the &amp;lt;body&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
      To begin the development, run `npm start` or `yarn start`.&lt;br /&gt;
      To create a production bundle, use `npm run build` or `yarn build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;n be referenced from the HTML.&lt;br /&gt;
&lt;br /&gt;
      Unlike &amp;quot;/favicon.ico&amp;quot; or &amp;quot;favicon.ico&amp;quot;, &amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot; will&lt;br /&gt;
      work correctly both with client-side routing and a non-root public URL.&lt;br /&gt;
      Learn how to configure a non-root public URL by running `npm run build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;React App&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;noscript&amp;gt;&lt;br /&gt;
		You need to enable JavaScript to run this app.&lt;br /&gt;
	&amp;lt;/noscript&amp;gt;&lt;br /&gt;
	&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      This HTML file is a template.&lt;br /&gt;
      If you open it directly in the browser, you will see an empty page.&lt;br /&gt;
&lt;br /&gt;
      You can add webfonts, meta tags, or analytics to this file.&lt;br /&gt;
      The build step will place the bundled scripts into the &amp;lt;body&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
      To begin the development, run `npm start` or `yarn start`.&lt;br /&gt;
      To create a production bundle, use `npm run build` or `yarn build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, shrink-to-fit=no&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#000000&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      manifest.json provides metadata used when your web app is added to the&lt;br /&gt;
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;manifest&amp;quot; href=&amp;quot;%PUBLIC_URL&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, shrink-to-fit=no&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#000000&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      manifest.json provides metadata used when your web app is added to the&lt;br /&gt;
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;manifest&amp;quot; href=&amp;quot;%PUBLIC_URL%/manifest.json&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      Notice the use of %PUBLIC_URL% in the tags above.&lt;br /&gt;
      It will be replaced with the URL of the `public` folder during the build.&lt;br /&gt;
      Only files inside the `public` folder can be referenced from the HTML.&lt;br /&gt;
&lt;br /&gt;
      Unlike &amp;quot;/favicon.ico&amp;quot; or &amp;quot;favicon.ico&amp;quot;, &amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot; will&lt;br /&gt;
      work correctly both with client-side routing and a non-root public URL.&lt;br /&gt;
      Learn how to configure a non-root public URL by running `npm run build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;React App&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;noscript&amp;gt;&lt;br /&gt;
		You need to enable JavaScript to run this app.&lt;br /&gt;
	&amp;lt;/noscript&amp;gt;&lt;br /&gt;
	&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      This HTML file is a template.&lt;br /&gt;
      If you open it directly in the browser, you will see an empty page.&lt;br /&gt;
&lt;br /&gt;
      You can add webfonts, meta tags, or analytics to this file.&lt;br /&gt;
      The build step will place the bundled scripts into the &amp;lt;body&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
      To begin the development, run `npm start` or `yarn start`.&lt;br /&gt;
      To create a production bundle, use `npm run build` or `yarn build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;%/manifest.json&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      Notice the use of %PUBLIC_URL% in the tags above.&lt;br /&gt;
      It will be replaced with the URL of the `public` folder during the build.&lt;br /&gt;
      Only files inside the `public` folder can be referenced from the HTML.&lt;br /&gt;
&lt;br /&gt;
      Unlike &amp;quot;/favicon.ico&amp;quot; or &amp;quot;favicon.ico&amp;quot;, &amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot; will&lt;br /&gt;
      work correctly both with client-side routing and a non-root public URL.&lt;br /&gt;
      Learn how to configure a non-root public URL by running `npm run build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;React App&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;noscript&amp;gt;&lt;br /&gt;
		You need to enable JavaScript to run this app.&lt;br /&gt;
	&amp;lt;/noscript&amp;gt;&lt;br /&gt;
	&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      This HTML file is a template.&lt;br /&gt;
      If you open it directly in the browser, you will see an empty page.&lt;br /&gt;
&lt;br /&gt;
      You can add webfonts, meta tags, or analytics to this file.&lt;br /&gt;
      The build step will place the bundled scripts into the &amp;lt;body&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
      To begin the development, run `npm start` or `yarn start`.&lt;br /&gt;
      To create a production bundle, use `npm run build` or `yarn build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;)}&amp;gt;setState on click&amp;lt;/button&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
    );&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export default PublicMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''public/index.html''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, shrink-to-fit=no&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#000000&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      manifest.json provides metadata used when your web app is added to the&lt;br /&gt;
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;manifest&amp;quot; href=&amp;quot;%PUBLIC_URL%/manifest.json&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      Notice the use of %PUBLIC_URL% in the tags above.&lt;br /&gt;
      It will be replaced with the URL of the `public` folder during the build.&lt;br /&gt;
      Only files inside the `public` folder can be referenced from the HTML.&lt;br /&gt;
&lt;br /&gt;
      Unlike &amp;quot;/favicon.ico&amp;quot; or &amp;quot;favicon.ico&amp;quot;, &amp;quot;%PUBLIC_URL%/favicon.ico&amp;quot; will&lt;br /&gt;
      work correctly both with client-side routing and a non-root public URL.&lt;br /&gt;
      Learn how to configure a non-root public URL by running `npm run build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;React App&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;noscript&amp;gt;&lt;br /&gt;
		You need to enable JavaScript to run this app.&lt;br /&gt;
	&amp;lt;/noscript&amp;gt;&lt;br /&gt;
	&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;!--&lt;br /&gt;
      This HTML file is a template.&lt;br /&gt;
      If you open it directly in the browser, you will see an empty page.&lt;br /&gt;
&lt;br /&gt;
      You can add webfonts, meta tags, or analytics to this file.&lt;br /&gt;
      The build step will place the bundled scripts into the &amp;lt;body&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
      To begin the development, run `npm start` or `yarn start`.&lt;br /&gt;
      To create a production bundle, use `npm run build` or `yarn build`.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Exemple 3: react-openlayers==&lt;br /&gt;
*https://www.npmjs.com/package/react-openlayers&lt;br /&gt;
A minimal React wrapper of OpenLayers 3+ written in TypeScript&lt;br /&gt;
&lt;br /&gt;
Instal·lo les dependències:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ npm install react-openlayers --save-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Descarrego el projecte i l'instal·lo:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/allenhwkim/react-openlayers.git&lt;br /&gt;
$ cd react-openlayers&lt;br /&gt;
$ npm install&lt;br /&gt;
$ npm start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i funciona:&lt;br /&gt;
*http://localhost:9001/#/&lt;br /&gt;
És un codi que té moltes opcions&lt;br /&gt;
{{Autor}}, abril 2020&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>