Skip to content

Conversation

@njsoftdev
Copy link

Hello!
This is base functionaltiy to support clustering placemarks in Android and iOS.
This PR only add new functionality and add new example

Example how to use:

YandexMap(onMapCreated: (YandexMapController yandexMapController) async {
                  controller = yandexMapController;
                  await controller!.move(point: Point(latitude: 54.790246, longitude: 32.048847), zoom: 10.0);
                  // Clusterized collection created here
                  clusterizedPlacemarkCollection = await controller!.addClusterizedPlacemarkCollection(
                      iconName: '', // 'lib/assets/user.png',
                      textAlign: 'center',
                      textColor: {'r': 211, 'g': 165, 'b': 103},
                      backgroundColor: {'r': 19, 'g': 43, 'b': 32},
                      strokeColor: {'r': 173, 'g': 171, 'b': 118},
		      fontSize: 15
                  );
                  <dynamic>[
                    [54.790246, 32.048847],
                    [54.789960, 32.048933],
                    [54.789998, 32.050607],
                    [54.790072, 32.053096],
                    [54.788770, 32.054276],
                    [54.786203, 32.054426],
                    [54.791448, 32.047774],
                    [54.793147, 32.050821],
                  ].forEach((element) {
                      await controller!.addClusterizedPlacemark(clusterizedPlacemarkCollection!, Placemark(
                                        point: point,
                                       style: const PlacemarkStyle(
                                       iconName: 'lib/assets/place.png',
                                        opacity: 0.9,
                           ),
                       ));
                  });
                },
              )

@cream-cheeze
Copy link
Contributor

There is my uncompleted PR which also adds clustering support and much more:

  • adding of nested collections (not only clusterized)
  • clearing and removing collections
  • adding composite icons
  • support for dynamic cluster icons (if you want do display number of items in cluster, for example).

I had no time to make some changes to the PR, so it hang up for a while... I'm afraid that it is almost impossible to friend our branches. Let me finish my PR and then participate in review - I'll try to finish this weekend or next week.

@DCrow
Copy link
Collaborator

DCrow commented Nov 8, 2021

Closing since clusterization has been implemented in #157

@DCrow DCrow closed this Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants