Results 1 to 3 of 3
Thread: RoR + mysql ..
Hybrid View
-
18th January 2010 16:06 #1
RoR + mysql ..
,
... googlemaps rails. locations - "":

, mysql-. googlemaps - id, location, lat, lng.
lat lng GPS (, the best , ...).
, , ...
, , ... ...
mappable.Code:cat controllers/gmapscontroller.rb ---------------------------------------------------------------------------------- require 'rubygems' require 'google_geocode' class GmapsController < ApplicationController include Geokit::Geocoders def index lat = Googlemaps_dev.find(:all, :select => "lat") lng = Googlemaps_dev.find(:all, :select => "lng") @map = GMap.new("map_div") @map.control_init(:large_map => true,:map_type => true) @map.center_zoom_init([lat, lng],7) @map.overlay_init(GMarker.new([lat, lng],:title => "Test Location", :info_window => "Test Location 2")) end end
- , ...Code:class Googlemaps_dev < ActiveRecord::Base acts_as_mappable end
, :
, , lng lat ... !Code:+----+----------------+---------+---------+ | id | location | lat | lng | +----+----------------+---------+---------+ | 1 | Home | 42.7046 | 23.3276 | +----+----------------+---------+---------+ 1 row in set (0.01 sec)
, ... ?
Code:>> lat = Googlemaps_dev.find(:all, :select => "lat") => [#<Googlemaps_dev lat: 42.7046>]
!
' ... ! - ... !
-
18th January 2010 19:06 #2
, CMS ( 2 ) Flash API- Google. MySQL, XML AS.
PM, .
-
20th January 2010 08:45 #3
Problem solved :)
, ,
, ...
' ... ! - ... !




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in