ansarali / jquery-ui-map

Automatically exported from code.google.com/p/jquery-ui-map
0 stars 0 forks source link

gmap() is not chainable #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
gmap() should return 'this' so it can be chained ie: 

$('.map').gmap().show();

Original issue reported on code.google.com by mi...@openmile.com on 14 Feb 2012 at 3:56

GoogleCodeExporter commented 8 years ago
It is. Get the latest from the trunk and try eg: 
$('#map_canvas').gmap().gmap('addMarker', { 'position': '58.7973333,12.0502107' 
}, function(map, marker) {
    console.log(marker);
});
However some methods are returning a value, e.g. get, addMarker. 

Original comment by johansalllarsson on 14 Feb 2012 at 4:10

GoogleCodeExporter commented 8 years ago
Update: The constructor is returning this, but since a code change the methods 
are not chainable, and some will never be unless the logic changes, eg. get, 
addMarker returns either null or an object. Easiest way is to return this on 
each method. The best way would be to do it in the method call section if it 
weren't for the nulls and marker objects being returned. If you have any ideas 
mail me :) 

Original comment by johansalllarsson on 15 Feb 2012 at 10:08