Есть ли способ вызвать Gmaps4rails.geocode(адрес) изнутри javascript?

Я хотел бы сделать что-то вроде этого в 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 = [];
    }

0 ответов

Другие вопросы по тегам