Skip to content
Discussion options

You must be logged in to vote

Yes, that's possible by utilizing the feature properties.

  final _points = <Feature<Point>>[
    const Feature(
      geometry: Point(Geographic(lon: 9.17, lat: 47.68)),
      properties: {'name': 'Marker 1'},
    ),
    const Feature(
      geometry: Point(Geographic(lon: 9.17, lat: 48)),
      properties: {'name': 'Marker 2'},
    ),
  ];

You can then use the name value by using this:

MarkerLayer(
  points: _points,
  textField: '{name}', // <- reads name property
  textAllowOverlap: true,
  iconImage: _imageLoaded ? 'marker' : null,
  iconSize: 0.15,
  iconAnchor: IconAnchor.bottom,
  textOffset: const [0, 1],
),

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@schuhbacca
Comment options

@josxha
Comment options

Answer selected by josxha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants