1

I want to vary the radius of a circle made in Google Maps API3 based on a jQuery Mobile range selector:

http://goo.gl/T1OHC

However, Chrome Web Developer keeps issuing the error "Uncaught Error: Invalid value for property : _" every time I alter my slider. Why?

dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206
  • It does? Latest version of Chrome on Windows 7 64 bit, Mac OS X 10.7.3 and Fedora 15 all have your example running and no errors in JavaScript console in dev tools. – Tony Miller Mar 19 '12 at 13:48
  • Oh, I am sorry. I had just fixed it two hours ago. The problem was that Google Maps API3 was parsing `$(this).val()` as a string, whereas an integer value was needed. To solve this issue, I replaced `$(this).val()` with `parseInt($(this).val())`. The Devil's in the details in this case. – dangerChihuahua007 Mar 19 '12 at 15:42

1 Answers1

3

I solved my own problem. The problem was that Google Maps API3 was parsing $(this).val() as a string, whereas an integer value was needed. To solve this issue, I replaced $(this).val() with parseInt($(this).val()).

Here is my final javascript.

$('input#circleRadius').change(function() {
    circle.setRadius(parseInt($(this).val()));
    });
});
dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206