Release 0.9.0
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// Listen for location updates/additions
|
||||
if (data.data_type === 'location_update' && data.payload && data.payload.location) {
|
||||
const locationId = data.payload.location_id;
|
||||
const loc = data.payload.location;
|
||||
|
||||
// Update locations dictionary with new data
|
||||
locations[locationId] = loc;
|
||||
|
||||
// Remove old shape if exists
|
||||
if (locationShapes[locationId]) {
|
||||
map.removeLayer(locationShapes[locationId]);
|
||||
delete locationShapes[locationId];
|
||||
}
|
||||
|
||||
// Create new shape
|
||||
try {
|
||||
const shape = createLocationShape(locationId, loc);
|
||||
locationShapes[locationId] = shape;
|
||||
} catch (error) {
|
||||
console.error('[MAP] Error updating location shape:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for location removals
|
||||
if (data.data_type === 'location_remove' && data.payload && data.payload.location_id) {
|
||||
const locationId = data.payload.location_id;
|
||||
|
||||
if (locationShapes[locationId]) {
|
||||
map.removeLayer(locationShapes[locationId]);
|
||||
delete locationShapes[locationId];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user