Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add undefined check for "options.data" in addHeatMapLayer: function (map, options) #130

Open
allanes87 opened this issue Dec 20, 2016 · 1 comment

Comments

@allanes87
Copy link

allanes87 commented Dec 20, 2016

Hi,
Firtsly, thks for this API!
I found a little issue to improve:
In "jmelosegui.googlemap.js", function: "addHeatMapLayer: function (map, options)", Is possible add a undefined check:

var data = [];
            **if (options.data !== undefined)**
            {
                for (var j = 0; j < options.data.length; j++) {
                    data.push(new google.maps.LatLng(options.data[j].lat, options.data[j].lng));
                }
            }

Without this little improve I have this error:

Uncaught TypeError: Cannot read property 'length' of undefined.

@jmelosegui
Copy link
Owner

You PR is wellcome!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants