| void initMap() async { | |
| final map = ArcGISMap.withBasemapStyle(BasemapStyle.arcGISTopographic); | |
| map.initialViewpoint = Viewpoint.fromCenter( | |
| ArcGISPoint( | |
| x: 155233, // in BNG projection | |
| y: 734855, | |
| spatialReference: SpatialReference(wkid: 27700), // BNG | |
| ), | |
| scale: 700000, | |
| ); | |
| _mapViewController.arcGISMap = map; | |
| _mapViewController.graphicsOverlays.addAll([ | |
| _routeGraphicsOverlay, | |
| _stopsGraphicsOverlay, | |
| _meetingPointGraphicsOverlay | |
| ]); | |
| final stopsImage = await ArcGISImage.fromAsset('assets/pin.png'); | |
| _stopsGraphicsOverlay.renderer = SimpleRenderer( | |
| symbol: PictureMarkerSymbol.withImage(stopsImage) | |
| ..height = 30 | |
| ..width = 30); | |
| _routeGraphicsOverlay.renderer = SimpleRenderer( | |
| symbol: SimpleLineSymbol( | |
| style: SimpleLineSymbolStyle.dash, | |
| color: const Color.fromARGB(255, 0, 77, 70), | |
| width: 5.0)); | |
| final image = await ArcGISImage.fromAsset('assets/bus.png'); | |
| _meetingPointGraphicsOverlay.renderer = SimpleRenderer( | |
| symbol: PictureMarkerSymbol.withImage(image) | |
| ..height = 40 | |
| ..width = 40); | |
| } |