State persistence in Angular Maps component

20 Sep 20221 minute to read

State Persistence

State persistence allows the Maps to retain the current model value in the browser cookies for state maintenance. This action is handled through the enablePersistence property which is set to false by default. When this property is set to true, some of the Maps component model values are preserved even after the page is refreshed.

import { Component, OnInit } from '@angular/core';
import { Maps, Selection} from '@syncfusion/ej2-angular-maps';
import { world_map } from 'world-map.ts';
    selector: 'app-container',
    `<ejs-maps id='rn-container' [enablePersistence] = 'enablePersistence' [zoomSettings] = 'zoomSettings'>
    <e-layer  [shapeData]= 'shapeData'></e-layer>

export class AppComponent implements OnInit {
    public shapeData: object;
    public zoomSettings: object;
    public enablePersistence: boolean;
    ngOnInit(): void {
        this.shapeData = world_map;
        this.enablePersistence = true;
        this.zoomSettings = {
            enable: true,