gmaps4rails replaceMarkers not working (javascript)

后端 未结 2 1832
执笔经年
执笔经年 2021-01-15 18:32

stack details ruby 1.9.2p180, rails 3.0.9, gmaps4rails 1.0.2, jquery.json-2.3.min.js

Background I am a newbie to gmaps4rails and re

2条回答
  •  轮回少年
    2021-01-15 19:18

    This issue is resolved by upgrading to gmaps4rails 1.3.0. Another problem I faced was to make sure that the replaceMarkers method is given an array of markers, not a JSON string

    Note that when you are creating a new map (on the server side), you must give a JSON string for the markers.

    When you are calling replaceMarkers on the client side (in JS), you must give an array of marker objects.

提交回复
热议问题