Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I cannot share code of my custom renderer, so here are general architecture:</p> <ol> <li><p>A <strong>MapView</strong> (extends <strong>View</strong>) component with <strong>pan</strong> and <strong>zoom</strong> properties and list of <strong>MapLayers</strong></p></li> <li><p>A <strong>MapLayer</strong> abstract class with <strong>onClick</strong> and <strong>render</strong> methods. This class has two subclasses:</p> <p>2.1. A <strong>GridLayer</strong> class which <strong>render</strong> methods draws grid depending on <strong>MapView</strong>'s <strong>pan</strong> and <strong>zoom</strong></p> <p>2.2. A <strong>MarkerLayer</strong> class which stores <strong>Markers</strong> and renders them.</p></li> <li><p><strong>Marker</strong> stores <strong>latitude</strong>, <strong>longitude</strong> and also HashMap of <strong>attributes</strong> (such as color, id etc)</p></li> <li><p>To map <strong>Marker</strong>'s <strong>latitude</strong> and <strong>longitude</strong> to <strong>MapView</strong>'s x and y I use instance <strong>IProjector</strong> interface, currently - Mercator Projector with formulas from Wikipedia</p></li> <li><p>To render <strong>Marker</strong>'s <strong>MarkerLayer</strong> uses instance of <strong>MarkerRenderer</strong> abstract class. I have two <strong>MarkerRenderers</strong>: <strong>SimpleMarkerRenderer</strong>, which draws circles (their stroke and fill colors are taken from <strong>Marker</strong>'s <strong>attributes</strong>), and <strong>ImageMarkerRenderer</strong>, which draws images (image ids taken from <strong>Marker</strong>'s <strong>attributes</strong>)</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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