Topic: User control stops working with the RealTilesetSizeExample script

Hi!

I have enabled Allow User Control on the OnlineMapsTileSetControl script and it works like expected, but when I add the RealTilesetSizeExample to the same GameObject all user control stops working. Does anyone else have the same problem and know how to fix this?

Re: User control stops working with the RealTilesetSizeExample script

Hello.

Most likely the problem is that the camera is very far from the map.
Try increasing OnlineMapsUtils.maxRaycastDistance.

If the problem persists, please send a screenshot of Online Maps component.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by GingerBeard 2018-10-09 12:39:57)

Re: User control stops working with the RealTilesetSizeExample script

It didn't work by increasing OnlineMapsUtils.maxRaycastDistance.

I've worked around it by creating a new script calling this function when a button is clicked instead of using the example script.

public void SetRealSize() {
    // Get distance (km) between corners of map
    Vector2 distance = OnlineMapsUtils.DistanceBetweenPoints(OnlineMaps.instance.topLeftPosition,
        OnlineMaps.instance.bottomRightPosition);

    // Set tileset size
    OnlineMaps.instance.tilesetSize = distance * 1000;

    // Redraw map
    OnlineMaps.instance.Redraw();


    SetCenterPosition();
}

I attached a screenshot of the Online Maps component.

Edit: I still get some problems it seems like. Control is lost whenever zoom gets to 15 or 19 for some reason.

Just as a test I did this which stops all control at 15 or 19 zoom:

private void Update() {

        if(zoomValue != onlineMaps.zoom) {
            SetRealSize();
        }
        zoomValue = onlineMaps.zoom;
    }

    public void SetRealSize() {
        // Get distance (km) between corners of map
        Vector2 distance = OnlineMapsUtils.DistanceBetweenPoints(OnlineMaps.instance.topLeftPosition,
            OnlineMaps.instance.bottomRightPosition);

        // Set tileset size
        OnlineMaps.instance.tilesetSize = distance * 1000;

        // Redraw map
        OnlineMaps.instance.Redraw();


        SetCenterPosition();
}

Edit 2: For some reason it works better with having Use Elevation set to true. I can go between 11 and 20 without the losing user control.

Edit 3: Updated to the latest version but I still have the same problem.

Post's attachments

Attachment icon onlinemaps component.png 41.34 kb, 63 downloads since 2018-10-09 

4 (edited by GingerBeard 2018-10-15 11:14:20)

Re: User control stops working with the RealTilesetSizeExample script

I have solved it by settings Zoom (1-20) under Use Elevation to 1 - 20. It seems like it is generating a new mesh which has the same size as the real size tilemap. When use elevation was turned off, the mesh was smaller than the tileset so I lost user control as the mouse wasn't hovering over any mesh.