I'd like to store map bounds in a JSON object. For code completion, I've declared the object using JSDoc:
/**
* @name MapBounds
* @class MapBounds
* This class represents a map boundary definition.
*
* @property {number} minLat Specifies the minimum latitude of the boundary.
* @property {number} minLon Specifies the minimum longitude of the boundary.
* @property {number} maxLat Specifies the maximum latitude of the boundary.
* @property {number} maxLon Specifies the maximum longitude of the boundary.
*/
When it comes time to create the MapBounds object, my code looks similar to this (this example doesn't have real lat/lon values):
var newMapBounds = MapBounds( {minLat: 50, minLon: 50, maxLat: 100, maxLon: 100} );
I'm specifying the object using JSON and then casting it to the type I need. Is there a better way to do this?
Thanks.