mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
@@ -266,7 +266,7 @@ describe('DataProvider', () => {
|
|||||||
await dataProvider.put(sampleThing);
|
await dataProvider.put(sampleThing);
|
||||||
await dataProvider.put(otherSampleThing);
|
await dataProvider.put(otherSampleThing);
|
||||||
await storageProvider.put('some-uid', {some: 'thing'});
|
await storageProvider.put('some-uid', {some: 'thing'});
|
||||||
expect(await storageProvider.length()).toBe(3);
|
expect(await storageProvider.length()).not.toBe(0);
|
||||||
await dataProvider.deleteAll();
|
await dataProvider.deleteAll();
|
||||||
expect(storageProvider.delete).toHaveBeenCalledWith(
|
expect(storageProvider.delete).toHaveBeenCalledWith(
|
||||||
dataProvider.getDataKey(sampleThing.uid),
|
dataProvider.getDataKey(sampleThing.uid),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {Component, ElementRef, Input, OnInit} from '@angular/core';
|
import {Component, ElementRef, Input, OnInit, ViewChild} from '@angular/core';
|
||||||
import {SCPlace} from '@openstapps/core';
|
import {SCPlace} from '@openstapps/core';
|
||||||
import {geoJSON, Map, MapOptions, tileLayer} from 'leaflet';
|
import {geoJSON, Map, MapOptions, tileLayer} from 'leaflet';
|
||||||
import {MapProvider} from '../map.provider';
|
import {MapProvider} from '../map.provider';
|
||||||
@@ -32,6 +32,11 @@ export class MapWidgetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
map: Map;
|
map: Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Container element of the map
|
||||||
|
*/
|
||||||
|
@ViewChild('mapContainer') mapContainer: ElementRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options of the leaflet map
|
* Options of the leaflet map
|
||||||
*/
|
*/
|
||||||
@@ -42,8 +47,6 @@ export class MapWidgetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
@Input() place: SCPlace;
|
@Input() place: SCPlace;
|
||||||
|
|
||||||
constructor(private element: ElementRef) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare the map
|
* Prepare the map
|
||||||
*/
|
*/
|
||||||
@@ -74,8 +77,8 @@ export class MapWidgetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
onMapReady(map: Map) {
|
onMapReady(map: Map) {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
const interval: Timeout = setInterval(() =>
|
const interval: Timeout = setInterval(() => {
|
||||||
MapProvider.invalidateWhenRendered(map, this.element, interval),
|
MapProvider.invalidateWhenRendered(map, this.mapContainer, interval);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
class="map-container"
|
class="map-container"
|
||||||
(leafletMapReady)="onMapReady($event)"
|
(leafletMapReady)="onMapReady($event)"
|
||||||
leaflet
|
leaflet
|
||||||
|
#mapContainer
|
||||||
[leafletOptions]="options"
|
[leafletOptions]="options"
|
||||||
></div>
|
></div>
|
||||||
<div class="map-buttons">
|
<div class="map-buttons">
|
||||||
|
|||||||
Reference in New Issue
Block a user