-
Notifications
You must be signed in to change notification settings - Fork 152
Modest Maps Reference
Point is a pixel position on screen, expressed as a simple pair of numbers.
The methods of Map that convert to/from points work relative to the map's
containing div element. This is used to locate the pixel within
the map, starting at (0, 0)
in the upper-lefthand corner.
{% highlight js %}var point = new com.modestmaps.Point(x, y){% endhighlight %}
{% highlight js %}com.modestmaps.Point.interpolate(p1, p2, t){% endhighlight %}
Get a point between two other points, biased by t
.
Location is a geographical latitude and longitude, expressed as a simple pair of
numbers. For example, San Francisco is near 37°N, 122°W or new com.modestmaps.Location(37, -122)
.
{% highlight js %}new com.modestmaps.Location(lat, lon){% endhighlight %}
{% highlight js %}com.modestmaps.Location.distance(l1, l2, r){% endhighlight %}
{% highlight js %}com.modestmaps.Location.interpolate(l1, l2, f){% endhighlight %}
Coordinate is a three dimensional position that helps to convert between zoom levels. It is expressed as a row, column, and zoom. Zoom levels in Modest Maps start at zero, and grow as you zoom in. Tile providers typically express tile locations in such coordinates, which is why the map provider interface understands coordinates and not points. Whole-number coordinates in the tile grid correspond exactly to tile images requested from the provider server.
{% highlight js %}new com.modestmaps.Coordinate(row, column, zoom){% endhighlight %}