Hello,
I am using following code to set my marker in Here Maps. Now, I want to update the position of the marker in the app from the GeoCoordinates(13.6211, 123.1903) to GeoCoordinates(15.6211, 125.1903) when pressing on a button.
But, I am confused and I didn't find a way to update the marker in the map.
import 'package:flutter/material.dart';
import 'package:here_sdk/core.dart';
import 'package:here_sdk/mapview.dart';
void main() {
SdkContext.init(IsolateOrigin.main);
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'HERE SDK for Flutter - Hello Map!',
home: HereMap(onMapCreated: _onMapCreated),
);
}
void _onMapCreated(HereMapController hereMapController) {
var image = new MapImage.withFilePathAndWidthAndHeight(
'<?xml version="1.0" standalone="no"?>' +
'<svg width="4cm" height="4cm" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" version="1.1">' +
'<path d="M 100 100 L 300 100 L 200 300 z"M fill="red" stroke="blue" stroke-width="3" />' +
'</svg>',
100,
100);
var mapmarker = new MapMarker(GeoCoordinates(13.6211, 123.1903), image);
hereMapController.mapScene.addMapMarker(mapmarker);
hereMapController.mapScene.loadSceneForMapScheme(MapScheme.normalNight,
(MapError error) {
if (error != null) {
print("Map scene not loaded. MapError: " + error.toString());
}
debugPrint('hi im dino');
hereMapController.camera
.lookAtPointWithDistance(GeoCoordinates(13.6211, 123.1903), 1000.0);
hereMapController.release();
});
hereMapController.release();
}
}
Thanks.