mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[ios] Enabled traffic button
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -811,6 +811,7 @@
|
|||||||
"privacy_policy" = "Privacy policy";
|
"privacy_policy" = "Privacy policy";
|
||||||
"terms_of_use" = "Terms of use";
|
"terms_of_use" = "Terms of use";
|
||||||
"button_layer_subway" = "Metro";
|
"button_layer_subway" = "Metro";
|
||||||
|
"button_layer_traffic" = "Traffic";
|
||||||
"layers_title" = "Map Styles and Layers";
|
"layers_title" = "Map Styles and Layers";
|
||||||
"subway_data_unavailable" = "Metro map is unavailable";
|
"subway_data_unavailable" = "Metro map is unavailable";
|
||||||
"title_error_downloading_bookmarks" = "An error occurred";
|
"title_error_downloading_bookmarks" = "An error occurred";
|
||||||
|
|||||||
@@ -833,6 +833,7 @@
|
|||||||
"privacy_policy" = "Privacy policy";
|
"privacy_policy" = "Privacy policy";
|
||||||
"terms_of_use" = "Terms of use";
|
"terms_of_use" = "Terms of use";
|
||||||
"button_layer_subway" = "Subway";
|
"button_layer_subway" = "Subway";
|
||||||
|
"button_layer_traffic" = "Traffic";
|
||||||
"layers_title" = "Map Styles and Layers";
|
"layers_title" = "Map Styles and Layers";
|
||||||
"subway_data_unavailable" = "Subway map is unavailable";
|
"subway_data_unavailable" = "Subway map is unavailable";
|
||||||
"title_error_downloading_bookmarks" = "An error occurred";
|
"title_error_downloading_bookmarks" = "An error occurred";
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ class BottomMenuLayersCell: UITableViewCell {
|
|||||||
updateOutdoorButton()
|
updateOutdoorButton()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@IBOutlet private var trafficButton: BottomMenuLayerButton! {
|
||||||
|
didSet {
|
||||||
|
updateTrafficButton()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var onClose: (()->())?
|
var onClose: (()->())?
|
||||||
|
|
||||||
@@ -32,6 +37,7 @@ class BottomMenuLayersCell: UITableViewCell {
|
|||||||
outdoorButton.setupWith(image: UIImage(resource: .btnMenuOutdoors), text: L("button_layer_outdoor"))
|
outdoorButton.setupWith(image: UIImage(resource: .btnMenuOutdoors), text: L("button_layer_outdoor"))
|
||||||
isoLinesButton.setupWith(image: UIImage(resource: .btnMenuIsomaps), text: L("button_layer_isolines"))
|
isoLinesButton.setupWith(image: UIImage(resource: .btnMenuIsomaps), text: L("button_layer_isolines"))
|
||||||
subwayButton.setupWith(image: UIImage(resource: .btnMenuSubway), text: L("button_layer_subway"))
|
subwayButton.setupWith(image: UIImage(resource: .btnMenuSubway), text: L("button_layer_subway"))
|
||||||
|
trafficButton.setupWith(image: UIImage(resource: .btnMenuTraffic), text: L("button_layer_traffic"))
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
@@ -56,6 +62,11 @@ class BottomMenuLayersCell: UITableViewCell {
|
|||||||
let enabled = MapOverlayManager.outdoorEnabled()
|
let enabled = MapOverlayManager.outdoorEnabled()
|
||||||
outdoorButton.setStyleAndApply(styleFor(enabled))
|
outdoorButton.setStyleAndApply(styleFor(enabled))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateTrafficButton() {
|
||||||
|
let enabled = MapOverlayManager.trafficEnabled()
|
||||||
|
trafficButton.setStyleAndApply(styleFor(enabled))
|
||||||
|
}
|
||||||
|
|
||||||
@IBAction func onCloseButtonPressed(_ sender: Any) {
|
@IBAction func onCloseButtonPressed(_ sender: Any) {
|
||||||
onClose?()
|
onClose?()
|
||||||
@@ -75,6 +86,11 @@ class BottomMenuLayersCell: UITableViewCell {
|
|||||||
let enable = !MapOverlayManager.outdoorEnabled()
|
let enable = !MapOverlayManager.outdoorEnabled()
|
||||||
MapOverlayManager.setOutdoorEnabled(enable)
|
MapOverlayManager.setOutdoorEnabled(enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBAction func onTrafficButton(_ sender: Any) {
|
||||||
|
let enable = !MapOverlayManager.trafficEnabled()
|
||||||
|
MapOverlayManager.setTrafficEnabled(enable)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension BottomMenuLayersCell: MapOverlayManagerObserver {
|
extension BottomMenuLayersCell: MapOverlayManagerObserver {
|
||||||
@@ -89,6 +105,10 @@ extension BottomMenuLayersCell: MapOverlayManagerObserver {
|
|||||||
func onOutdoorStateUpdated() {
|
func onOutdoorStateUpdated() {
|
||||||
updateOutdoorButton()
|
updateOutdoorButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func onTrafficStateUpdated() {
|
||||||
|
updateTrafficButton()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension BottomMenuLayersCell {
|
private extension BottomMenuLayersCell {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24128" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||||
<device id="ipad9_7" orientation="landscape" layout="fullscreen" appearance="light"/>
|
<device id="ipad9_7" orientation="landscape" layout="fullscreen" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24063"/>
|
||||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@@ -81,26 +81,35 @@
|
|||||||
<rect key="frame" x="16" y="58" width="308" height="64"/>
|
<rect key="frame" x="16" y="58" width="308" height="64"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g13-pK-Eig" userLabel="Outdoor Button" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g13-pK-Eig" userLabel="Outdoor Button" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="102.5" height="64"/>
|
<rect key="frame" x="0.0" y="0.0" width="1024" height="64"/>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="onOutdoorButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="UQ2-jj-fPc"/>
|
<action selector="onOutdoorButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="UQ2-jj-fPc"/>
|
||||||
</connections>
|
</connections>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="edA-Mo-3Vx" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="edA-Mo-3Vx" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
||||||
<rect key="frame" x="102.5" y="0.0" width="103" height="64"/>
|
<rect key="frame" x="1024" y="0.0" width="1024" height="64"/>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="onIsoLinesButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="3LS-C2-2Mc"/>
|
<action selector="onIsoLinesButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="3LS-C2-2Mc"/>
|
||||||
</connections>
|
</connections>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4US-fZ-cyg" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4US-fZ-cyg" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
||||||
<rect key="frame" x="205.5" y="0.0" width="102.5" height="64"/>
|
<rect key="frame" x="2048" y="0.0" width="1024" height="64"/>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="onSubwayButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="xxM-kP-gT1"/>
|
<action selector="onSubwayButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="xxM-kP-gT1"/>
|
||||||
</connections>
|
</connections>
|
||||||
</view>
|
</view>
|
||||||
|
<view contentMode="scaleToFill" id="95L-lU-yCQ" customClass="BottomMenuLayerButton" customModule="CoMaps" customModuleProvider="target">
|
||||||
|
<rect key="frame" x="-358" y="-352" width="1024" height="768"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<viewLayoutGuide key="safeArea" id="ZQs-ua-gDZ"/>
|
||||||
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="onTrafficButton:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="tie-i7-JaB"/>
|
||||||
|
</connections>
|
||||||
|
</view>
|
||||||
</subviews>
|
</subviews>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="70" id="d0H-kE-IWx"/>
|
<constraint firstAttribute="height" constant="70" id="d0H-kE-IWx"/>
|
||||||
@@ -144,6 +153,7 @@
|
|||||||
<outlet property="isoLinesButton" destination="edA-Mo-3Vx" id="qoC-8w-EqY"/>
|
<outlet property="isoLinesButton" destination="edA-Mo-3Vx" id="qoC-8w-EqY"/>
|
||||||
<outlet property="outdoorButton" destination="g13-pK-Eig" id="ib1-aw-Qv9"/>
|
<outlet property="outdoorButton" destination="g13-pK-Eig" id="ib1-aw-Qv9"/>
|
||||||
<outlet property="subwayButton" destination="4US-fZ-cyg" id="eQB-HR-Wgl"/>
|
<outlet property="subwayButton" destination="4US-fZ-cyg" id="eQB-HR-Wgl"/>
|
||||||
|
<outlet property="trafficButton" destination="95L-lU-yCQ" id="O9W-En-8Rc"/>
|
||||||
</connections>
|
</connections>
|
||||||
<point key="canvasLocation" x="137.6953125" y="201.953125"/>
|
<point key="canvasLocation" x="137.6953125" y="201.953125"/>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
274720472E439DDE00C516DF /* traff_storage.cpp */,
|
274720472E439DDE00C516DF /* traff_storage.cpp */,
|
||||||
);
|
);
|
||||||
name = traffxml;
|
name = traffxml;
|
||||||
path = ../../traffxml;
|
path = ../../libs/traffxml;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
67BECB831DDA474400FC4E99 /* Frameworks */ = {
|
67BECB831DDA474400FC4E99 /* Frameworks */ = {
|
||||||
|
|||||||
Reference in New Issue
Block a user