Topic: How can I change marker's layer?
I want to put one marker into the layer which ignore raycast layer?
And also I want to know how to change the collider size for marker in editor.
Thank you!
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → How can I change marker's layer?
I want to put one marker into the layer which ignore raycast layer?
And also I want to know how to change the collider size for marker in editor.
Thank you!
Hello.
Please specify what control do you use and about what markers you ask (2D or 3D).
2D marker, tap on marker control, one marker I add cover other markers, I want to put this marker in the lower layer, or make it ignore the tap event.
I mean: Tileset Control, UIImage Control or some other.
tileset control
For tileset control all 2D markers drawn in «Map GameObject / Markers» in single mesh.
You can find this GameObject and change layer. But it will change the layer for all markers.
When the markers overlap, triggered event of marker that is added last.
If you want to the events of some marker do not overlap events of the other markers, add it first, or remove it from «OnlineMaps.markers» and insert to begin of list.
I added the marker first, but still cover the markers added after. So I will try to remove and insert it again, how to insert it to the begin of OnlineMaps.markers?
Please look at the image I upload, Does it mean that the Marker 1 is the first marker I added. It still cover some markers I add later. Is there some bug ?
Please show the script where you add a events of markers.
private void Start () {
// Add RadarMarker
radarMarker = OnlineMaps.instance.AddMarker(new Vector2(0, 0), radarMarkerTexture, "Radar");
radarMarker.align = OnlineMapsAlign.Center;
}
private void OnLocationChanged(Vector2 position) {
// Get player's position
playerPosition = position;
//Adjust radarMarker's position
radarMarker.position = playerPosition;
// Add marker.
AddMarkersBasedonPlayerPosition (playerPosition);
// Redraw map.
OnlineMaps.instance.Redraw();
}
The radar marker cover some markers added later
I think I understand: you're talking about the order of drawing of markers, instead of the order of events of markers, right?!
Use «OnlineMapsTileSetControl.markerComparer», to manually sort the markers.
Example:
http://infinity-code.com/atlas/online-m … ample.html
No, I'm talking about the event order. For instance, I want to tap and show the tooltip. But the radar marker cover some of the markers I add later based on the playerPosition.
In this case, I do not understand you.
I just checked, shows the tooltip of the last the marker (screenshot attached).
maybe it's hard to describe, please show me how to do this " remove it from «OnlineMaps.markers» and insert to begin of list.". I will try to see if it works for me
private void MoveMarker(OnlineMapsMarker marker)
{
OnlineMapsMarker[] markers = OnlineMaps.instance.markers;
int offset = 0;
for (int i = markers.Length - 1; i > 0; i--)
{
OnlineMapsMarker m = markers[i];
if (marker == m) offset++;
else markers[i + offset] = m;
}
markers[0] = marker;
}Thank you for the code, but it doesn't work. And after hundreds try, I found some issue about the method "AddMarker".
radarMarker = OnlineMaps.instance.AddMarker(new Vector2(0, 0), "Radar");
radarMarker.texture = radarMarkerTexture;
radarMarker.align = OnlineMapsAlign.Center;
radarMarker.position = playerPosition; //I Worte this code in OnlocationChanged
I used these code above to add radarMarker, it fit the event issue, the radarMarker wouldn't cover(I mean block the tap event) any markers I added later. But the position of the radarmarker is not at the position.
radarMarker = OnlineMaps.instance.AddMarker(new Vector2(0, 0), RadarMarkerTexture, "Radar");
radarMarker.align = OnlineMapsAlign.Center;
radarMarker.position = playerPosition; //I Worte this code in OnlocationChanged
I I used these code above to add radarMarker, the position is right. But it's weird that the upper half of the radarMarker cover(I mean block the tap event) the markers I added later, the lower half of the radarMarker wouldn't cover(I mean block the tap event) any markers I added later.
I think maybe there is some bug in the source code. Pls help to fix it. Thank you!
And I add An image to show you the issue, one player is added by editor, the other player and the green radarMarker are add by code like this
playerMarker = OnlineMaps.instance.AddMarker(new Vector2(0, 0), "Player");
playerMarker.texture = playerMarkerTexture;
playerMarker.align = OnlineMapsAlign.Center;
playerMardker.position = playerPosition; //I Worte this code in OnlocationChanged
radarMarker marker's code is similar as above.
In editor they all have same location and align point, and the 2 playerMarker used same playerMarkerTexture. But in the game view, 2 players have different location, and the green radar is not in the center of the playerMarker.
It's just a mystic.
I just tested it, and I have all the markers in the right location.
Please send us a scene where we can see and test it to support (support@infinity-code.com).
We will check and immediately fix the problem.
Just now I found that if I added radarMarker.Init() after assigning the texture, it would be in the right position, but again, it blocked the tap event of some other markers on it's upper haft area.
Please send something (a scene or video), to I can see the problem.
I already sent you the unity package. pls help me to solve the problem.
Infinity Code Forum → Online Maps Help → How can I change marker's layer?
Powered by PunBB, supported by Informer Technologies, Inc.