Search results

State Persistence in Angular Maps component

28 Jul 2021 / 1 minute to read

State Persistence

State persistence allows the Maps to retain the current modal value in the browser cookies for state maintenance. This action is handled through the enablePersistence property which is set to false by default. When it is set to true, some of the Maps component model values will be retained even after refreshing the page.

Copied to clipboard
import { Component, ViewEncapsulation, ViewChild } 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 {
    ngOnInit(): void {
        public shapeData: Object = world_map;
        public enablePersistence = true;
         public zoomSettings: Object = {
            enable: true,