liderbug Posted December 12, 2019 Share Posted December 12, 2019 I'm trying to get a Google map to work with polygons. var points = [ new google.maps.LatLng(39.0174, -104.6634) , new google.maps.LatLng(39.0190, -104.6634) , new google.maps.LatLng(39.0190, -104.6700) , new google.maps.LatLng(39.0174, -104.6700) ]; works just fine. ---------------------- $q1 = mysqli_query ($con, "select * from points;"); while ($r1 = mysqli_fetch_row ($q1)) { $results[$n++] = "(" . $r1[0] . ")"; } var points = <?php echo json_encode($results); ?>; alert (points); in both cases displays the same (39.0174,-104.6634... numbers. Except the sql doesn't display anything - well the map but not the polygon. I'd love any help you can give. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/309670-json_encode-failing/ Share on other sites More sharing options...
requinix Posted December 12, 2019 Share Posted December 12, 2019 Do a View Source of your page, and find the line where you outputted $results. Does the Javascript look correct? Quote Link to comment https://forums.phpfreaks.com/topic/309670-json_encode-failing/#findComment-1572442 Share on other sites More sharing options...
liderbug Posted December 12, 2019 Author Share Posted December 12, 2019 Oh, never mind, don't ask. 😖 Snake bite, <sigh> Quote Link to comment https://forums.phpfreaks.com/topic/309670-json_encode-failing/#findComment-1572464 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.