radzen-blazor icon indicating copy to clipboard operation
radzen-blazor copied to clipboard

added ability to customize markers and default cursor

Open sawcheg opened this issue 2 years ago • 1 comments

  1. added parameter IconSrc in RadzenGoogleMapMarker for customize markers
  2. added parameter DraggingCursor in RadzenGoogleMap for customize default cursor
  3. modified page in demo project for use case

sawcheg avatar Jul 08 '22 11:07 sawcheg

I was certainly looking for the ability to customise markers. It this likely to be incorporated?

BassetMan avatar Jul 26 '22 11:07 BassetMan

hi, can you tell when this request will be reviewed?

sawcheg avatar Sep 16 '22 07:09 sawcheg

Sorry for the very late feedback.

Unfortunately we cannot accept this pull request as it is.

The current issues are:

  1. Does not follow naming convetions e.g. data_markers - we do not use underscore in the middle of variable names,
  2. I don't fully understand the purpose of IsShouldRender. No other component has such a property and it is very hard to reason what it does and how/when to use it.
  3. The customizeMap JS function shouldn't support just the drag cursor. Ideally it should accept an options object that can be directly passed to setOptions.

akorchev avatar Sep 16 '22 07:09 akorchev

Issues 1 and 3 have been resolved

IsShouldRender property is needed to block all markers from updating when the afterrender method is called. for example on the demo page, this happens when the map is clicked or when the parent component is rendered.

Added usage example of this property to demo page

sawcheg avatar Sep 16 '22 10:09 sawcheg

There should be a better way to handle this without the need of this IsShouldRender property. I am afraid we can't accept such API.

akorchev avatar Sep 16 '22 11:09 akorchev

Update handling is implemented inside the component.

Please review last changes

sawcheg avatar Sep 16 '22 13:09 sawcheg

I thoroughly reviewed the pull request and believe we should implement those features ourselves. The current implementation seems overly complex and we don't fully understand it in order to merge it in the library and continue supporting it.

akorchev avatar Sep 16 '22 13:09 akorchev

We will probably expose a Parameter called options which will be passed directly to setOptions.

<RadzenGoogleMap Options=@(new Dictionary<string, object> { { "draggingCursor", "myCursor" }, { "disableDefaultUI", true } })>

And we will make sure zoom and center are not reset while markers are updated.

akorchev avatar Sep 16 '22 13:09 akorchev