longitudeToPixelX method

double longitudeToPixelX(
  1. double longitude
)

Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain zoom level.

@param longitude the longitude coordinate that should be converted. @param zoomLevel the zoom level at which the coordinate should be converted. @param tileSize the tile size @return the pixel X coordinate of the longitude value.

Implementation

double longitudeToPixelX(double longitude) {
  return (longitude + 180) / 360 * _mapSize;
}