我想在javascript中做这样的事情:
var latLngMatches = Gmaps4rails.geocode(address);
...
这在嵌入式 javascript 中不起作用。事实上,如果我进入 Chrome 控制台并键入Gmaps4Rails
,则 javascript 中的对象没有函数geocode
(请参见下文)。
问题:有没有办法Gmaps4rails.geocode(address)
从 javascript 中调用?
JAVASCRIPT 控制台输出:
function Gmaps4Rails() {
this.map = null;
this.visibleInfoWindow = null;
this.userLocation = null;
this.geolocationFailure = function() {
return false;
};
this.callback = function() {
return false;
};
this.customClusterer = function() {
return false;
};
this.infobox = function() {
return false;
};
this.jsTemplate = false;
this.default_map_options = {
id: 'map',
draggable: true,
detect_location: false,
center_on_user: false,
center_latitude: 0,
center_longitude: 0,
zoom: 7,
maxZoom: null,
minZoom: null,
auto_adjust: true,
auto_zoom: true,
bounds: [],
raw: {}
};
this.default_markers_conf = {
title: "",
picture: "",
width: 22,
length: 32,
draggable: false,
do_clustering: false,
randomize: false,
max_random_distance: 100,
list_container: null,
offset: 0,
raw: {}
};
this.markers = [];
this.boundsObject = null;
this.polygons = [];
this.polylines = [];
this.circles = [];
this.markerClusterer = null;
this.markerImages = [];
}