|
2 | 2 |
|
3 | 3 | import android.content.Context; |
4 | 4 |
|
| 5 | +import androidx.annotation.Nullable; |
| 6 | + |
| 7 | +import com.minedata.minemap.geometry.LatLng; |
5 | 8 | import com.minemap.minemapsdk.maps.ImplMineMapOptions; |
6 | 9 |
|
| 10 | +import java.util.Map; |
| 11 | + |
7 | 12 | import io.flutter.plugin.common.BinaryMessenger; |
8 | 13 |
|
9 | 14 | public class FMMMapBuilder { |
10 | 15 |
|
11 | | - public FMMMapController build(int id, Context context, BinaryMessenger binaryMessenger, |
12 | | - String viewType, ImplMineMapOptions options) { |
| 16 | + private int trafficRote; |
| 17 | + private int zoomLevel; |
| 18 | + private int minZoomLevel; |
| 19 | + private int maxZoomLevel; |
| 20 | + private int tilt; |
| 21 | + private int bearing; |
| 22 | + private Integer mapType; |
| 23 | + private Boolean trafficEnabled; |
| 24 | + private Boolean wmtsEnabled; |
| 25 | + private Boolean repaint; |
| 26 | + private Boolean showDebugActive; |
| 27 | + private Boolean fillWaterEnabled; |
| 28 | + private Boolean connected; |
| 29 | + private Boolean compassEnabled; |
| 30 | + private Boolean logoEnabled; |
| 31 | + private Boolean attributionEnabled; |
| 32 | + private Boolean scaleEnabled; |
| 33 | + private Boolean rotateGesturesEnabled; |
| 34 | + private Boolean tiltGesturesEnabled; |
| 35 | + private Boolean zoomGesturesEnabled; |
| 36 | + private Boolean zoomControlsEnabled; |
| 37 | + private Boolean doubleTapGesturesEnable; |
| 38 | + private Boolean scrollGesturesEnabled; |
| 39 | + private Boolean allGesturesEnabled; |
| 40 | + private LatLng center; |
| 41 | + |
| 42 | + |
| 43 | + public FMMMapController build(int id, Context context, BinaryMessenger binaryMessenger, @Nullable Map<String, Object> creationParams) { |
13 | 44 |
|
14 | 45 | FMMMapController fmmMapController = new FMMMapController(id, context, binaryMessenger, |
15 | | - viewType, options); |
| 46 | + creationParams); |
| 47 | + |
| 48 | + fmmMapController.setMapType(mapType); |
| 49 | + fmmMapController.setTrafficEnabled(trafficEnabled); |
| 50 | + fmmMapController.setTrafficRote(trafficRote); |
| 51 | + fmmMapController.setCenter(center); |
| 52 | + fmmMapController.setZoomLevel(zoomLevel); |
| 53 | + fmmMapController.setMinZoomLevel(minZoomLevel); |
| 54 | + fmmMapController.setMaxZoomLevel(maxZoomLevel); |
| 55 | + fmmMapController.setTilt(tilt); |
| 56 | + fmmMapController.setBearing(bearing); |
| 57 | + fmmMapController.setWmtsEnabled(wmtsEnabled); |
| 58 | + fmmMapController.setRepaint(repaint); |
| 59 | + fmmMapController.setShowDebugActive(showDebugActive); |
| 60 | + fmmMapController.setFillWaterEnabled(fillWaterEnabled); |
| 61 | + fmmMapController.setConnected(connected); |
| 62 | + fmmMapController.setCompassEnabled(compassEnabled); |
| 63 | + fmmMapController.setLogoEnabled(logoEnabled); |
| 64 | + fmmMapController.setAttributionEnabled(attributionEnabled); |
| 65 | + fmmMapController.setScaleEnabled(scaleEnabled); |
| 66 | + fmmMapController.setRotateGesturesEnabled(rotateGesturesEnabled); |
| 67 | + fmmMapController.setTiltGesturesEnabled(tiltGesturesEnabled); |
| 68 | + fmmMapController.setZoomGesturesEnabled(zoomGesturesEnabled); |
| 69 | + fmmMapController.setZoomControlsEnabled(zoomControlsEnabled); |
| 70 | + fmmMapController.setDoubleTapGesturesEnabled(doubleTapGesturesEnable); |
| 71 | + fmmMapController.setScrollGesturesEnabled(scrollGesturesEnabled); |
| 72 | + fmmMapController.setAllGesturesEnabled(allGesturesEnabled); |
| 73 | + |
| 74 | + return fmmMapController; |
| 75 | + } |
| 76 | + |
| 77 | + public FMMMapBuilder center(LatLng center) { |
| 78 | + this.center = center; |
| 79 | + return this; |
| 80 | + } |
| 81 | + |
| 82 | + public FMMMapBuilder zoomLevel(int zoomLevel) { |
| 83 | + this.zoomLevel = zoomLevel; |
| 84 | + return this; |
| 85 | + } |
| 86 | + |
| 87 | + public FMMMapBuilder minZoomLevel(int minZoomLevel) { |
| 88 | + this.minZoomLevel = minZoomLevel; |
| 89 | + return this; |
| 90 | + } |
| 91 | + |
| 92 | + public FMMMapBuilder maxZoomLevel(int maxZoomLevel) { |
| 93 | + this.maxZoomLevel = maxZoomLevel; |
| 94 | + return this; |
| 95 | + } |
| 96 | + |
| 97 | + public FMMMapBuilder trafficRote(int trafficRote) { |
| 98 | + this.trafficRote = trafficRote; |
| 99 | + return this; |
| 100 | + } |
| 101 | + |
| 102 | + public FMMMapBuilder tilt(int tilt) { |
| 103 | + this.tilt = tilt; |
| 104 | + return this; |
| 105 | + } |
| 106 | + |
| 107 | + public FMMMapBuilder bearing(int bearing) { |
| 108 | + this.bearing = bearing; |
| 109 | + return this; |
| 110 | + } |
| 111 | + |
| 112 | + public FMMMapBuilder mapType(Integer mapType) { |
| 113 | + this.mapType = mapType; |
| 114 | + return this; |
| 115 | + } |
| 116 | + |
| 117 | + public FMMMapBuilder trafficEnabled(Boolean trafficEnabled) { |
| 118 | + this.trafficEnabled = trafficEnabled; |
| 119 | + return this; |
| 120 | + } |
| 121 | + |
| 122 | + public FMMMapBuilder wmtsEnabled(Boolean wmtsEnabled) { |
| 123 | + this.wmtsEnabled = wmtsEnabled; |
| 124 | + return this; |
| 125 | + } |
| 126 | + |
| 127 | + |
| 128 | + public FMMMapBuilder repaint(Boolean repaint) { |
| 129 | + this.repaint = repaint; |
| 130 | + return this; |
| 131 | + } |
| 132 | + |
| 133 | + public FMMMapBuilder showDebugActive(Boolean showDebugActive) { |
| 134 | + this.showDebugActive = showDebugActive; |
| 135 | + return this; |
| 136 | + } |
| 137 | + |
| 138 | + public FMMMapBuilder fillWaterEnabled(Boolean fillWaterEnabled) { |
| 139 | + this.fillWaterEnabled = fillWaterEnabled; |
| 140 | + return this; |
| 141 | + } |
| 142 | + |
| 143 | + public FMMMapBuilder connected(Boolean connected) { |
| 144 | + this.connected = connected; |
| 145 | + return this; |
| 146 | + } |
| 147 | + |
| 148 | + public FMMMapBuilder compassEnabled(Boolean compassEnabled) { |
| 149 | + this.compassEnabled = compassEnabled; |
| 150 | + return this; |
| 151 | + } |
| 152 | + |
| 153 | + public FMMMapBuilder logoEnabled(Boolean logoEnabled) { |
| 154 | + this.logoEnabled = logoEnabled; |
| 155 | + return this; |
| 156 | + } |
| 157 | + |
| 158 | + public FMMMapBuilder attributionEnabled(Boolean attributionEnabled) { |
| 159 | + this.attributionEnabled = attributionEnabled; |
| 160 | + return this; |
| 161 | + } |
| 162 | + |
| 163 | + public FMMMapBuilder scaleEnabled(Boolean scaleEnabled) { |
| 164 | + this.scaleEnabled = scaleEnabled; |
| 165 | + return this; |
| 166 | + } |
| 167 | + |
| 168 | + |
| 169 | + public FMMMapBuilder rotateGesturesEnabled(Boolean rotateGesturesEnabled) { |
| 170 | + this.rotateGesturesEnabled = rotateGesturesEnabled; |
| 171 | + return this; |
| 172 | + } |
| 173 | + |
| 174 | + public FMMMapBuilder tiltGesturesEnabled(Boolean tiltGesturesEnabled) { |
| 175 | + this.tiltGesturesEnabled = tiltGesturesEnabled; |
| 176 | + return this; |
| 177 | + } |
| 178 | + |
| 179 | + public FMMMapBuilder zoomGesturesEnabled(Boolean zoomGesturesEnabled) { |
| 180 | + this.zoomGesturesEnabled = zoomGesturesEnabled; |
| 181 | + return this; |
| 182 | + } |
| 183 | + |
| 184 | + public FMMMapBuilder zoomControlsEnabled(Boolean zoomControlsEnabled) { |
| 185 | + this.zoomControlsEnabled = zoomControlsEnabled; |
| 186 | + return this; |
| 187 | + } |
| 188 | + |
| 189 | + public FMMMapBuilder doubleTapGesturesEnable(Boolean doubleTapGesturesEnable) { |
| 190 | + this.doubleTapGesturesEnable = doubleTapGesturesEnable; |
| 191 | + return this; |
| 192 | + } |
| 193 | + |
| 194 | + public FMMMapBuilder scrollGesturesEnabled(Boolean scrollGesturesEnabled) { |
| 195 | + this.scrollGesturesEnabled = scrollGesturesEnabled; |
| 196 | + return this; |
| 197 | + } |
16 | 198 |
|
17 | | - return fmmMapController; |
| 199 | + public FMMMapBuilder allGesturesEnabled(Boolean allGesturesEnabled) { |
| 200 | + this.allGesturesEnabled = allGesturesEnabled; |
| 201 | + return this; |
18 | 202 | } |
19 | 203 | } |
0 commit comments