lib/geos/google_maps/api_2.rb
def to_g_polyline_api2(polyline_options = {}, options = {})
      klass = if options[:short_class]
        'GPolyline'
      else
        'google.maps.Polyline'
      end

      poly_opts = if polyline_options[:polyline_options]
        Geos::Helper.camelize_keys(polyline_options[:polyline_options])
      end

      args = [
        (polyline_options[:color] ? "'#{Geos::Helper.escape_javascript(polyline_options[:color])}'" : 'null'),
        (polyline_options[:weight] || 'null'),
        (polyline_options[:opacity] || 'null'),
        (poly_opts ? poly_opts.to_json : 'null')
      ].join(', ')

      "new #{klass}([#{self.to_g_lat_lng(options).join(', ')}], #{args})"
    end
def to_g_polyline_api2(polyline_options = {}, options = {})
      klass = if options[:short_class]
        'GPolyline'
      else
        'google.maps.Polyline'
      end

      poly_opts = if polyline_options[:polyline_options]
        Geos::Helper.camelize_keys(polyline_options[:polyline_options])
      end

      args = [
        (polyline_options[:color] ? "'#{Geos::Helper.escape_javascript(polyline_options[:color])}'" : 'null'),
        (polyline_options[:weight] || 'null'),
        (polyline_options[:opacity] || 'null'),
        (poly_opts ? poly_opts.to_json : 'null')
      ].join(', ')

      "new #{klass}([#{self.to_g_lat_lng(options).join(', ')}], #{args})"
    end
def to_g_polyline_api2 ( polyline_options = { } , options = { } ) klass = if options [ :short_class ] 'GPolyline' else 'google.maps.Polyline' end poly_opts = if polyline_options [ :polyline_options ] Geos :: Helper . camelize_keys ( polyline_options [ :polyline_options ] ) end args = [ ( polyline_options [ :color ] ? "'#{Geos::Helper.escape_javascript(polyline_options[:color])}'" : 'null' ) , ( polyline_options [ :weight ] || 'null' ) , ( polyline_options [ :opacity ] || 'null' ) , ( poly_opts ? poly_opts . to_json : 'null' ) ] . join ( ', ' ) "new #{klass}([#{self.to_g_lat_lng(options).join(', ')}], #{args})" end
Returns a new GPolyline. Note that this GPolyline just uses whatever
 coordinates are found in the sequence in order, so it might not
 make much sense at all.

 The options Hash follows the Google Maps API arguments to the
 GPolyline constructor and include :color, :weight, :opacity and
 :options. 'null' is used in place of any unset options.
Returns a new GPolyline . Note that this GPolyline just uses whatever coordinates are found in the sequence in order so it might not make much sense at all .