Overview
OpenLayer supports a Geolocation API and a Feature API, which can be combined to display the current location of the user. The positioning feature is used to display the cyan colored marker on the map.
Improvements
Show the current location on the map by adding a geolocation vector layer.
Remove raster variables from the global scope and add them to OlMain state. Mutating raster values using global variables would be a React anti-pattern since React provides state management to achieve the desired functionality in a safer and error-proof way.
Overview OpenLayer supports a Geolocation API and a Feature API, which can be combined to display the current location of the user. The positioning feature is used to display the cyan colored marker on the map.
Improvements
Before
After