
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
openlayers-serializer
Advanced tools
A utility library for **[OpenLayers](https://openlayers.org/)** that allows you to **serialize and deserialize map objects**. Easily transfer map state, layers, views, and features between frontend and backend, or save and restore map configurations.
A utility library for OpenLayers that allows you to serialize and deserialize map objects. Easily transfer map state, layers, views, and features between frontend and backend, or save and restore map configurations.
ol.Map, ol.View, ol.layer.*, ol.source.*, and ol.Feature into JSONnpm install openlayers-serializer
# or
yarn add openlayers-serializer
import { serializeMap, deserializeMap } from "openlayers-serializer";
import Map from "ol/Map";
import View from "ol/View";
import TileLayer from "ol/layer/Tile";
import OSM from "ol/source/OSM";
// Create a map
const map = new Map({
view: new View({
center: [0, 0],
zoom: 2,
}),
layers: [
new TileLayer({
source: new OSM(),
}),
],
});
// Serialize map to JSON
const json = serializeMap(map);
console.log("Serialized:", json);
// Restore map from JSON
const restoredMap = deserializeMap(json);
console.log("Restored:", restoredMap);
serializeMap(map: Map): objectConvert an OpenLayers Map instance into JSON.
deserializeMap(json: object): MapRebuild an OpenLayers Map instance from JSON.
| Category | Supported Types |
|---|---|
| Map | ol/Map |
| View | ol/View |
| Layers | ol/layer/Tile, ol/layer/Vector |
| Sources | ol/source/OSM, ol/source/Vector |
| Features | ol/Feature (with geometry) |
(You can extend this table as support grows.)
Clone the repo and install dependencies:
git clone https://github.com/yourname/openlayers-serializer.git
cd openlayers-serializer
npm install
Run tests:
npm test
MIT License © 2025 rgbcmy
This project uses OpenLayers which is licensed under the BSD 2-Clause License.
Your support helps keep this project maintained and improved:
FAQs
A utility library for **[OpenLayers](https://openlayers.org/)** that allows you to **serialize and deserialize map objects**. Easily transfer map state, layers, views, and features between frontend and backend, or save and restore map configurations.
We found that openlayers-serializer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.