So I am having trouble understanding how json works my Json is not outputting any of of the articles through the infowindow does anyone here know what problems I am causing?
Ill first show my code in my add marker function
function addMarker(place)
{
// TODO get long and lat into one variable and put it in marker keys
var myLatlng = new google.maps.LatLng(place.latitude, place.longitude);
marker = new google.maps.Marker({
position: myLatlng,
map: map
});
// adding a anonymous function to trigger on click
marker.addListener('click', function() {
info.open(marker.get('map'), marker);
$.getJSON("application.py", {
geo: place.postal_code
});
});
Also here is my article search in my python backend
@app.route("/articles")
def articles():
"""Look up articles for geo."""
# TODO look up geo articles information and jsonify it to browser
r =lookup(request.args.get("geo"))
if not request.args.get("geo"):
raise RuntimeError("missing geo")
return jsonify([r])
search
, but the root cause is the same.flask run
toflask run --host=0.0.0.0 --port=8080
and it should work. As per this reddit post