[OpenLayers-Trac] Re: [OpenLayers] #3433: Implement OpenLayers.LonLat.fromArray for API-consistency

OpenLayers trac-20090302 at openlayers.org
Fri Jul 29 04:55:42 EDT 2011

#3433: Implement OpenLayers.LonLat.fromArray for API-consistency
 Reporter:  marcjansen        |       Owner:  crschmidt   
     Type:  feature           |      Status:  new         
 Priority:  minor             |   Milestone:  2.12 Release
Component:  BaseTypes.LonLat  |     Version:  SVN         
 Keywords:                    |       State:  Commit      

Comment(by marcjansen):

 Replying to [comment:2 bartvde]:
 > Hi Marc, thanks for the patch, I have one question/remark:
 > * we don't do much type checking for illegal arguments in OpenLayers at
 the moment, what made you decide to do type checking for this specific

 Nothing in particular. I wouldn't mind if the function looked like this:

 OpenLayers.LonLat.fromArray = function(arr) {
     return new OpenLayers.LonLat(arr[0], arr[1]);

 Do you suggest dropping the sanity checks in favor of the above?

 > Other than that I think this is good to go, I've confirmed your tests
 also pass in Safari 5.1.

 In the case of droppuing the checks the tests would have to be adjusted

Ticket URL: <http://trac.openlayers.org/ticket/3433#comment:4>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer

More information about the Trac mailing list