Skip to content

Commit d5b77d9

Browse files
Apply suggestions from code review
1 parent d2e9a0c commit d5b77d9

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/placesComponent/views/map_widget.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class _MapWidgetState extends ConsumerState<MapWidget> {
144144
alignment: Alignment.topRight,
145145
children: [
146146
maplibre.MapLibreMap(
147-
styleString: "https://nav.tum.de/martin/style/navigatum-basemap.json", // TODO: dark and light themes - Nathan
147+
styleString: "https://nav.tum.de/martin/style/navigatum-basemap.json",
148148
initialCameraPosition: maplibre.CameraPosition(
149149
target:
150150
// mapLibre and Google Maps have different latLng classes. This converts between them and also provides a default location. - Nathan
@@ -167,37 +167,33 @@ class _MapWidgetState extends ConsumerState<MapWidget> {
167167
myLocationRenderMode: maplibre.MyLocationRenderMode.compass,
168168
onMapCreated: (maplibre.MapLibreMapController controller) {
169169
_controller.complete(controller);
170-
// Previous 250ms mounted delay no longer needed as it is now handled by onStyleLoadedCallback
171170
},
172171

173172
onStyleLoadedCallback: () => {
174173
_controller.future.then((controller) async {
175174
final ByteData pinData = await rootBundle.load("assets/images/map/pin.webp");
176175
controller.addImage("pin", pinData.buffer.asUint8List());
177-
// Aligns better with Google Maps marker behavior
178176
controller.symbolManager?.setIconAllowOverlap(true);
179177
controller.symbolManager?.setIconIgnorePlacement(true);
180178
controller.symbolManager?.setTextAllowOverlap(true);
181179
controller.symbolManager?.setTextIgnorePlacement(true);
182180

183-
//replacement for "markers: widget.markers". I know, it's a bit longer. Sorry! - Nathan
184181
for (var marker in widget.markers) {
185182
controller.addSymbol(
186183
maplibre.SymbolOptions(
187-
iconSize: 3, // Not set by Google Markers, done by eye by comparing screenshots
184+
iconSize: 3,
188185
iconImage: "pin", // Theoretically this could be set based on the marker ID. But in the current app it's always the same anyway.
189186
iconRotate: marker.rotation,
190-
iconOffset: Offset(0, -5), // end of the point of the arrow is on the exact location (magic number (done by eye))
187+
iconOffset: Offset(0, -5),
191188
textField: marker.infoWindow.title,
192-
textOffset: Offset(0, -3), // magic number (done by eye)
189+
textOffset: Offset(0, -3),
193190
iconOpacity: marker.alpha,
194191
geometry: maplibre.LatLng(
195192
marker.position.latitude,
196193
marker.position.longitude,
197194
),
198195
zIndex: marker.zIndexInt,
199196
draggable: marker.draggable,
200-
// font handling is done by Google Maps automatically. It is not in maplibre.
201197
fontNames: ["Roboto Regular"],
202198
textColor: "#000000",
203199
textHaloColor: "#FFFFFF",
@@ -229,8 +225,6 @@ class _MapWidgetState extends ConsumerState<MapWidget> {
229225
isMapVisible = true;
230226
});
231227
}
232-
233-
// TODO: Implement floors and other features on NavigaTUM but not here. - Nathan
234228
}),
235229
},
236230
),

0 commit comments

Comments
 (0)