Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserControl on a pin #2525

Open
MickeyLeMutant opened this issue Mar 8, 2024 · 3 comments
Open

UserControl on a pin #2525

MickeyLeMutant opened this issue Mar 8, 2024 · 3 comments
Labels

Comments

@MickeyLeMutant
Copy link

Hi and thanks a lot to all the contributors for this hard work.

I have a question about visualize a usercontrol on a map.

The problem
I want to click on a pin and expand something like a control with buttons (a UserControl). Is it possible to do that ? I see the "Info" section into the sample demo but i understand it use style only. Perhaps i don't look on the right side.

Please, can you tell me if there is an other sample demo to look, an other discussion or how i can make it ?
Thanks in advance.

@pauldendulk
Copy link
Member

Yes this is possible, but you have to write that code yourself.

I think we do not have a sample anymore for that because it requires implementations on each platform and we want to reduce the need for maintenance. I did something like this on MAUI with v4. The Info event will return the screen coordinates (and the tapped feature if you tapped one), you can use the screen coordinates to show the user control over the MapControl.

I did this on MAUI and I needed a transparent (input-transparent and color-transparent) AbsoluteLayout placed on top of the MapControl to be able to place the user control on the screen coordinates (Perhaps I should derive the MAUI MapControl from AbsoluteLayout to make this easier).

btw, In most of my projects I end up placing the user control to side or the bottom, because it is just nice UI to have it in a fixed position.

@MickeyLeMutant
Copy link
Author

Thank you very much for the prompt response.

I will look into MAUI v4.

I noticed that you positioned the user control in the bottom corner. I'm accustomed to having information closer to the pin, but I will evaluate the advantage of placing it in a fixed position.

@pauldendulk
Copy link
Member

With 'UseControl' I assumed you are referring to a popup created with MAUI controls. We have no samples of that. About 'positioned the user control in the bottom corner', I think you are referring to the MapInfoWidget, this is just an option, mainly added to keep the samples simple. Another option would be to use a callout. Loot at the Info|SingleCallout sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants