烧瓶和烧瓶-googlemaps样式,路线,查看惨败

时间:2020-09-19 22:27:03

标签: python google-maps flask

我一直在尝试解决一些问题,并在引导卡中使用多个地图。但是我可以终生了解为什么会忽略VIEW中使用的样式im并应用默认的"height:300px;width:300px;margin:0;"。我已经一遍又一遍地阅读了docs,看了看各种例子,我所做的事情看起来很正确,但是我显然缺少了一些东西。

@blueprint.route('/device_cards', methods=['GET', 'POST'])
def device_cards():
    # creating a map in the view
    mymap = Map(
        identifier="mymap",
        varname="mymap",
        lat=61.081398,
        lng=16.169456,
        style="height:100%;width:100%;",
        zoom_control = False,
        maptype_control = False,
        scale_control = False,
        streetview_control = False,
        rotate_control = False,            
        cls="mymap",
        markers=[(61.081398, 16.169456)]
    )    
    
    return render_template('accounts/device-cards.html', mymap=mymap)

该屏幕截图显示了默认值 enter image description here

如果我将详细信息直接放在模板中,则可以正常工作,就像这样。

enter image description here

任何想法都会受到赞赏。

0 个答案:

没有答案