Skip to content

Refs issue #83 #91

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ <H2>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shows / hides the object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../ru/yandex/yandexmapkit/overlay/Overlay.html#compareTo(java.lang.Object)">compareTo</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used to determine z-order of visible elements.</TD>
</TR>
</TABLE>
&nbsp;
<P>
Expand Down Expand Up @@ -366,6 +374,23 @@ <H2>
</DL>
<HR>

<A NAME="compareTo(java.lang.Object)"><!-- --></A><H3>
compareTo</H3>
<PRE>
public int <B>compareTo</B>(java.lang.Object&nbsp;object)</PRE>
<DL>
<DD>Used to determine z-order of visible elements. Called when visibility of Overlay or OverlayItem changed. For instance, when user touched OverlayItem and Balloon became visible. See also <A HREF="../../../../ru/yandex/yandexmapkit/overlay/Overlay.html#setPriority(byte)"><CODE>setPriority(byte)</CODE></A><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - the object to be compared</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object</DL>
</DD>
</DL>
<HR>

<A NAME="getIRender()"><!-- --></A><H3>
getIRender</H3>
<PRE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ <H2>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the visibility of the object being rendered.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../ru/yandex/yandexmapkit/overlay/Overlay.html#compareTo(java.lang.Object)">compareTo</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used to determine z-order of visible elements.</TD>
</TR>
</TABLE>
&nbsp;
<P>
Expand Down Expand Up @@ -328,6 +336,23 @@ <H2>
</DL>
<HR>

<A NAME="compareTo(java.lang.Object)"><!-- --></A><H3>
compareTo</H3>
<PRE>
public int <B>compareTo</B>(java.lang.Object&nbsp;object)</PRE>
<DL>
<DD>Used to determine z-order of visible elements. Called when visibility of Overlay or OverlayItem changed. For instance, when user touched OverlayItem and Balloon became visible. See also <A HREF="../../../../ru/yandex/yandexmapkit/overlay/OverlayItem.html#setPriority(byte)"><CODE>setPriority(byte)</CODE></A><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - the object to be compared</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object</DL>
</DD>
</DL>
<HR>

<A NAME="getPriority()"><!-- --></A><H3>
getPriority</H3>
<PRE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.widget.ImageView;
import android.widget.TextView;
import ru.mapkittest.R;
import ru.yandex.yandexmapkit.overlay.OverlayItem;
import ru.yandex.yandexmapkit.overlay.balloon.BalloonItem;
import ru.yandex.yandexmapkit.overlay.balloon.OnBalloonListener;
import ru.yandex.yandexmapkit.utils.GeoPoint;
Expand Down Expand Up @@ -106,4 +107,18 @@ public void onBalloonAnimationEnd(BalloonItem balloonItem) {
// TODO Auto-generated method stub

}

@Override
public int compareTo(Object object) {
int thisPriority = getPriority();
int itemPriority = ((OverlayItem) object).getPriority();

if (thisPriority < itemPriority) {
return -1;
} else if (thisPriority == itemPriority) {
return 0;
} else {
return 1;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.widget.ImageView;
import android.widget.TextView;
import ru.mapkittest.R;
import ru.yandex.yandexmapkit.overlay.OverlayItem;
import ru.yandex.yandexmapkit.overlay.balloon.BalloonItem;
import ru.yandex.yandexmapkit.overlay.balloon.OnBalloonListener;
import ru.yandex.yandexmapkit.utils.GeoPoint;
Expand Down Expand Up @@ -76,4 +77,18 @@ public void onBalloonAnimationStart(BalloonItem balloonItem) {
@Override
public void onBalloonAnimationEnd(BalloonItem balloonItem) {
}

@Override
public int compareTo(Object object) {
int thisPriority = getPriority();
int itemPriority = ((OverlayItem) object).getPriority();

if (thisPriority < itemPriority) {
return -1;
} else if (thisPriority == itemPriority) {
return 0;
} else {
return 1;
}
}
}
14 changes: 14 additions & 0 deletions yandexmapkit-sample/src/ru/mapkittest/geocode/OverlayGeoCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ru.yandex.yandexmapkit.map.GeoCode;
import ru.yandex.yandexmapkit.map.GeoCodeListener;
import ru.yandex.yandexmapkit.overlay.Overlay;
import ru.yandex.yandexmapkit.overlay.OverlayItem;
import ru.yandex.yandexmapkit.utils.ScreenPoint;

public class OverlayGeoCode extends Overlay implements GeoCodeListener{
Expand Down Expand Up @@ -39,4 +40,17 @@ public void run() {
return true;
}

@Override
public int compareTo(Object object) {
int thisPriority = getPriority();
int itemPriority = ((OverlayItem) object).getPriority();

if (thisPriority < itemPriority) {
return -1;
} else if (thisPriority == itemPriority) {
return 0;
} else {
return 1;
}
}
}
13 changes: 13 additions & 0 deletions yandexmapkit-sample/src/ru/mapkittest/path/OverlayRect.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ public List<OverlayItem> prepareDraw() {
return draw;
}

@Override
public int compareTo(Object object) {
int thisPriority = getPriority();
int itemPriority = ((OverlayItem) object).getPriority();

if (thisPriority < itemPriority) {
return -1;
} else if (thisPriority == itemPriority) {
return 0;
} else {
return 1;
}
}
}
15 changes: 14 additions & 1 deletion yandexmapkit-sample/src/ru/mapkittest/path/OverlayRectItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,18 @@ public OverlayRectItem(GeoPoint geoPoint, Drawable drawable) {
super(geoPoint, drawable);
// TODO Auto-generated constructor stub
}


@Override
public int compareTo(Object object) {
int thisPriority = getPriority();
int itemPriority = ((OverlayItem) object).getPriority();

if (thisPriority < itemPriority) {
return -1;
} else if (thisPriority == itemPriority) {
return 0;
} else {
return 1;
}
}
}