- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
140 lines
2.9 KiB
Objective-C
140 lines
2.9 KiB
Objective-C
//
|
|
// AIRGoogleMapPolyline.m
|
|
//
|
|
// Created by Nick Italiano on 10/22/16.
|
|
//
|
|
|
|
#ifdef HAVE_GOOGLE_MAPS
|
|
#import <UIKit/UIKit.h>
|
|
#import "AIRGoogleMapPolyline.h"
|
|
#import "AIRGMSPolyline.h"
|
|
#import "AIRGoogleMapMarker.h"
|
|
#import "AIRGoogleMapMarkerManager.h"
|
|
#import <GoogleMaps/GoogleMaps.h>
|
|
#import <React/RCTUtils.h>
|
|
|
|
@implementation AIRGoogleMapPolyline
|
|
|
|
- (instancetype)init
|
|
{
|
|
if (self = [super init]) {
|
|
_polyline = [[AIRGMSPolyline alloc] init];
|
|
_polyline.strokeColor = _strokeColor;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
-(void)setCoordinates:(NSArray<AIRGoogleMapCoordinate *> *)coordinates
|
|
{
|
|
_coordinates = coordinates;
|
|
|
|
GMSMutablePath *path = [GMSMutablePath path];
|
|
|
|
if (!coordinates || coordinates.count == 0)
|
|
{
|
|
[path removeAllCoordinates];
|
|
return;
|
|
}
|
|
|
|
for (int i = 0; i < coordinates.count; i++) {
|
|
[path addCoordinate:coordinates[i].coordinate];
|
|
}
|
|
|
|
_polyline.path = path;
|
|
|
|
[self configureStyleSpansIfNeeded];
|
|
}
|
|
|
|
-(void)setStrokeColor:(UIColor *)strokeColor
|
|
{
|
|
_strokeColor = strokeColor;
|
|
_polyline.strokeColor = strokeColor;
|
|
[self configureStyleSpansIfNeeded];
|
|
}
|
|
|
|
-(void)setStrokeColors:(NSArray<UIColor *> *)strokeColors
|
|
{
|
|
NSMutableArray *spans = [NSMutableArray arrayWithCapacity:[strokeColors count]];
|
|
for (int i = 0; i < [strokeColors count]; i++)
|
|
{
|
|
GMSStrokeStyle *stroke;
|
|
|
|
if (i == 0) {
|
|
stroke = [GMSStrokeStyle solidColor:strokeColors[i]];
|
|
} else {
|
|
stroke = [GMSStrokeStyle gradientFromColor:strokeColors[i-1] toColor:strokeColors[i]];
|
|
}
|
|
|
|
[spans addObject:[GMSStyleSpan spanWithStyle:stroke]];
|
|
}
|
|
|
|
_strokeColors = strokeColors;
|
|
_polyline.spans = spans;
|
|
}
|
|
|
|
-(void)setStrokeWidth:(double)strokeWidth
|
|
{
|
|
_strokeWidth = strokeWidth;
|
|
_polyline.strokeWidth = strokeWidth;
|
|
}
|
|
|
|
- (void)setFillColor:(UIColor *)fillColor {
|
|
// fillColor not support
|
|
}
|
|
|
|
- (void)setLineDashPattern:(NSArray<NSNumber *> *)lineDashPattern {
|
|
_lineDashPattern = lineDashPattern;
|
|
[self configureStyleSpansIfNeeded];
|
|
}
|
|
|
|
-(void)setGeodesic:(BOOL)geodesic
|
|
{
|
|
_geodesic = geodesic;
|
|
_polyline.geodesic = geodesic;
|
|
}
|
|
|
|
-(void)setTitle:(NSString *)title
|
|
{
|
|
_title = title;
|
|
_polyline.title = _title;
|
|
}
|
|
|
|
-(void) setZIndex:(int)zIndex
|
|
{
|
|
_zIndex = zIndex;
|
|
_polyline.zIndex = zIndex;
|
|
}
|
|
|
|
-(void)setTappable:(BOOL)tappable
|
|
{
|
|
_tappable = tappable;
|
|
_polyline.tappable = tappable;
|
|
}
|
|
|
|
- (void)setOnPress:(RCTBubblingEventBlock)onPress {
|
|
_polyline.onPress = onPress;
|
|
}
|
|
|
|
- (void)configureStyleSpansIfNeeded {
|
|
if (!_strokeColor || !_lineDashPattern || !_polyline.path) {
|
|
return;
|
|
}
|
|
|
|
BOOL isLine = YES;
|
|
NSMutableArray *styles = [[NSMutableArray alloc] init];
|
|
for (NSInteger i = 0; i < _lineDashPattern.count; i++) {
|
|
if (isLine) {
|
|
[styles addObject:[GMSStrokeStyle solidColor:_strokeColor]];
|
|
} else {
|
|
[styles addObject:[GMSStrokeStyle solidColor:[UIColor clearColor]]];
|
|
}
|
|
isLine = !isLine;
|
|
}
|
|
|
|
_polyline.spans = GMSStyleSpans(_polyline.path, styles, _lineDashPattern, kGMSLengthRhumb);
|
|
}
|
|
|
|
@end
|
|
|
|
#endif
|