Skip to content
Snippets Groups Projects
Commit fa2ba366 authored by Bhabesh Bhabani Mukhopadhyay's avatar Bhabesh Bhabani Mukhopadhyay
Browse files

#VOAPP-13 : Save changed poi's data to localstorage

parent f03546f2
No related branches found
No related tags found
No related merge requests found
...@@ -96,6 +96,7 @@ export default{ ...@@ -96,6 +96,7 @@ export default{
actionModal() { actionModal() {
this.isModalVisible = false; this.isModalVisible = false;
this.saveToStore();
}, },
getPointOfInterest(id){ getPointOfInterest(id){
...@@ -105,6 +106,24 @@ export default{ ...@@ -105,6 +106,24 @@ export default{
this.poi = poi; this.poi = poi;
}, },
saveToStore(){
let This = this;
let lstPOI = JSON.parse(localStorage.getItem(CommonUtil.CONST_STORAGE_POI_LIST));
$.each(lstPOI, function(index, poi){
if(poi.pointOfInterestId === This.poi.pointOfInterestId)
{
poi.latitude=This.poi.latitude;
poi.longitude=This.poi.longitude;
poi.name=This.poi.name;
poi.pointOfInterestTypeId=This.poi.pointOfInterestTypeId;
poi.geoJSON=This.poi.geoJSON
poi.uploaded=false;
return false;
}
})
localStorage.setItem(CommonUtil.CONST_STORAGE_POI_LIST,JSON.stringify(lstPOI));
},
initMap() initMap()
{ {
let mapZoom = this.mapZoom; let mapZoom = this.mapZoom;
...@@ -263,6 +282,9 @@ export default{ ...@@ -263,6 +282,9 @@ export default{
map.on(['singleclick'],function(event){ map.on(['singleclick'],function(event){
let transFormCord = transform(event.coordinate, 'EPSG:3857','EPSG:4326'); let transFormCord = transform(event.coordinate, 'EPSG:3857','EPSG:4326');
This.poi.longitude = transFormCord[0];
This.poi.latitude = transFormCord[1];
map.getView().setCenter(fromLonLat(transFormCord)); map.getView().setCenter(fromLonLat(transFormCord));
let mapLayers = map.getLayers(); let mapLayers = map.getLayers();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment