Skip to content

Add marker anchor support#27

Merged
johnpryan merged 1 commit intofleaflet:masterfrom
milare:add-marker-anchor-support
Apr 25, 2018
Merged

Add marker anchor support#27
johnpryan merged 1 commit intofleaflet:masterfrom
milare:add-marker-anchor-support

Conversation

@milare
Copy link
Copy Markdown
Contributor

@milare milare commented Apr 23, 2018

Implements #26

@johnpryan
Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

Just a heads up, we are going to also make the offset calculation automatic:

      new Marker(
          width: 80.0,
          height: 80.0,
          point: new LatLng(53.3498, -6.2603),
          builder: (ctx) => new Container(
                child: new FlutterLogo(
                  colors: Colors.green,
                ),
              ),
          anchor: MarkerAnchor.center),

so that users won't need to think about dividing 80.0 / 2 and setting the anchor point manually.

Let me know if that doesn't work for your use case or you have any questions!

@johnpryan johnpryan merged commit 2270069 into fleaflet:master Apr 25, 2018
@johnpryan
Copy link
Copy Markdown
Collaborator

New API: 48a5a3e

@milare
Copy link
Copy Markdown
Contributor Author

milare commented Apr 25, 2018

That's even better, thanks!

@Leffe108
Copy link
Copy Markdown

Leffe108 commented Feb 9, 2021

It may help other people to know that this is how you specify anchorPos to Marker constructor.

Marker(
  anchorPos: AnchorPos.align(AnchorAlign.bottom),
  ...

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.

3 participants