Topic: Setting marker texture causes alignment issues

Setting the texture of a marker before it is added to a map causes that marker to always align to the top left corner, rather than the specified alignment.

The alignment works correctly if you add the marker to the map first, then update the texture.

Re: Setting marker texture causes alignment issues

Hello.

Thank you for the bug report.
Unfortunately, I could not reproduce the problem.
Video:
https://www.dropbox.com/s/lk72rj8xx0miw … 4.mp4?dl=0
I missed something?

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: Setting marker texture causes alignment issues

Sorry, I forgot to specify that this issue is encountered when adding the markers through code.

Here's an example

zoomedInCenterMarker = new OnlineMapsMarker {
            align = OnlineMapsAlign.Center,
            range = new OnlineMapsRange(min: MapSetupUIHandler.Instance.cacheRegionEditZoomLevel, max: OnlineMaps.MAXZOOM),
            OnDrag = delegate (OnlineMapsMarkerBase marker) { OnCenterMarkerDragged(); },
            texture = MapSetupUIHandler.Instance.editCenterTexture
        };
        OnlineMapsMarkerManager.AddItem(zoomedInCenterMarker);

Yields the top image in the attachment when combined with other markers which have had the texture set after AddItem has been called. You can see the center marker has been aligned such that the top left of the image is in the center, despite the code specifying that it should be centered.

zoomedInCenterMarker = new OnlineMapsMarker {
            align = OnlineMapsAlign.Center,
            range = new OnlineMapsRange(min: MapSetupUIHandler.Instance.cacheRegionEditZoomLevel, max: OnlineMaps.MAXZOOM),
            OnDrag = delegate (OnlineMapsMarkerBase marker) { OnCenterMarkerDragged(); },
            //texture = MapSetupUIHandler.Instance.editCenterTexture
        };
        OnlineMapsMarkerManager.AddItem(zoomedInCenterMarker);
        zoomedInCenterMarker.texture = MapSetupUIHandler.Instance.editCenterTexture;

When the texture is set after the issue is corrected, see the bottom image (no other code changes have occurred).

Post's attachments

Attachment icon Annotation 2020-01-13 165629.png 28.78 kb, 9 downloads since 2020-01-13 

Re: Setting marker texture causes alignment issues

I tested both of your ways and still cannot reproduce the problem.
If possible, send a scene (as a package) that has a problem to me (support@infinity-code.com) for testing.

To make it clear:
I do not need your working project.
I need any scene where this problem is appears.

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!