Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I guess we should put the teleportation on hold until the problem of a dynamically-drawn, clickable overlay is solved then! </p> </blockquote> <p>A dynamically-drawn, clickable overlay is merely a subclass of <a href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Overlay.html" rel="nofollow"><code>Overlay</code></a>. You will override one or both of the <code>draw()</code> methods to render your arrows using the <code>Canvas</code> 2D drawing API. You will override <code>onTap()</code> to be notified of taps on the map, to see if they tapped on an arrow. You add the overlay to the <code>MapView</code> via <code>addOverlays().add()</code>.</p> <blockquote> <p>Most overlays seem to be just .PNG files for markers</p> </blockquote> <p>Those are usually <code>ItemizedOverlay</code> classes. That's much simpler to implement, particularly if you are one of those developers (like me) who is all thumbs when it comes to <code>Canvas</code>. However, you cannot achieve what you want with an <code>ItemizedOverlay</code>, in all likelihood.</p> <blockquote> <p>I'd need to calculate the arrow based on direction to the destination (direction the arrow points) and the relative distance to that location (arrow length), so the overlay is something I'd have to come up with at run time.</p> </blockquote> <p>Correct. You can use a <code>Projection</code> to help convert between pixel space and geo-space (latitude and longitude), if needed.</p> <p>Note that this all assumes you are trying to use <code>MapActivity</code> and <code>MapView</code>. You are also welcome to use <code>WebView</code> or a plain browser to bring up your own JavaScript-based maps, if you prefer.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload