Invalid value for constructor parameter 0 in Fusion Table Google Map -


i appreciate in understanding reason console error: "invalid value constructor parameter 0" in instance. have map, , when click marker, path displayed via markers on-click listener. works fine when location array 'local' (within script file). instead have array of points contained within fusion table record governs other attributes of marker. following method works correctly:

    var path = [new google.maps.latlng(46.2932212,-122.8215887),new google.maps.latlng(46.2937995,-122.8194726)];      var polyline = new google.maps.polyline({path: path, strokecolor: "#cdcdcd", strokeopacity: 0, icons:[lineicon2],strokeweight: 2});      polyline.setmap(map); 

in fusion table, have column 'path2' (formatted text) contains same value 'path' variable above:

    [new google.maps.latlng(46.2932212,-122.8215887),new google.maps.latlng(46.2937995,-122.8194726)] 

i updated code:

  var path = path2;    var polyline = new google.maps.polyline({path: path, strokecolor: "#cdcdcd", strokeopacity: 0, icons:[lineicon2],strokeweight: 2});    polyline.setmap(map); 

when on-click event triggered, receive error in console: " invalid value constructor parameter 0: [new google.maps.latlng(46.2932212,-122.8215887),new google.maps.latlng(46.2937995,-122.8194726)]"

this suggests value table being brought in expected, has changed make error-out , not understanding occurring data when inserted cause error

(i know there other, better, methods such fusion table layers, achieve polyline display, still understand particular error scenario.)

thank suggestions!

this problem. text string not valid path, needs array of google.maps.latlng objects:

in fusion table, have column 'path2' (formatted text)

you need convert string:

"[new google.maps.latlng(46.2932212,-122.8215887),new google.maps.latlng(46.2937995,-122.8194726)]" 

into , array of google.maps.latlng objects.

these posts give options on how that:


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -