From nephish at gmail.com Mon Mar 3 20:26:32 2008
From: nephish at gmail.com (shawn bright)
Date: Mon, 3 Mar 2008 19:26:32 -0600
Subject: [Ym4r-user] question about updating the map
Message-ID: <384c93600803031726k1c90923ua48f88323b9cf65c@mail.gmail.com>
Hey there all.
I have a mapping app that uses ym4r_gm to build with google maps.
The markers i generate use the status of a machine to determine their color.
This way our customers can pull up the map and see a color coded
drawing where their machine is.
So, how would i go about making this to where it could update each
marker every 10 minutes or so. I would like to allow our customers to
leave their page pulled up all the time.
In an rhtml file, i would use the periodically_call_remote to update
the div, but these maps and markers are drawn with the controller.
Does this make sense?
the marker i use is a circle drawn with RMagick
That is the main thing i want to update,
here is what draws the markers
text = "some text for the marker balloons"
icon = GIcon.new(:image => "/images/tmp/#{site.id}.png", :icon_size =>
GSize.new((r*2),(r*2)),
:icon_anchor => GPoint.new(r,r),
:info_window_anchor => GPoint.new(r,r))
marker = GMarker.new([site.map_stat.lat.to_f , site.map_stat.long.to_f],
:title => title, :icon => icon, :info_window => text)
the #{site.id},png is the image drawn earlier by RMagick. That is the
main thing i want to update.
thanks for any help,
shawn
From skalla.raabjorn at gmx.de Wed Mar 12 15:01:00 2008
From: skalla.raabjorn at gmx.de (Skalla Raabjorn)
Date: Wed, 12 Mar 2008 20:01:00 +0100
Subject: [Ym4r-user] Marker event listener
Message-ID: <20080312200100.70b57bf5@sol.hackerzberg.local>
Hi All,
how can I implement something like this
http://econym.googlepages.com/example_hoverchange75.htm
with ym4r and rails?
I already have markers and the map working.
regards
Skalla
P.S. Please CC me.
From nephish at gmail.com Fri Mar 14 00:46:12 2008
From: nephish at gmail.com (shawn bright)
Date: Thu, 13 Mar 2008 23:46:12 -0500
Subject: [Ym4r-user] problem with rjs and marker group
Message-ID: <384c93600803132146y2ddd78d2t9c0d50a87f75066f@mail.gmail.com>
Lo there all,
i have a function that builds a bunch of markers to go on a google
map. I would like to update them with rjs.
Here is what i have so far.
def map_main_layout
@zoom = params[:zoom].to_i
@zoom = 14 if params[:zoom].nil?
@map = GMap.new("map_div")
# @map.control_init(:large_map => true, :map_type => true) #
(inserts map control)
# place the map where we want it ( center and zoom level )
@map.center_zoom_init([@group.group_map_stat.lat.to_f,
@group.group_map_stat.long.to_f], @zoom)
@map.set_map_type_init(GMapType::G_HYBRID_MAP)
@sites = @group.sites
@sites.each do |site|
# draw the circles
site.map_stat.circle_image(@zoom)
end
@all_markers = make_map_markers(@sites, @zoom)
@map.overlay_global_init(GMarkerGroup.new(true, @all_markers), "myGroup")
end
def make_map_markers(sites, zoom)
_all_markers = Hash.new
sites.each_with_index do |site, i|
# load the circles
text = site.map_stat.marker_window_html()
# r = site.map_stat.radius.to_i
zoomhash = {13 => 0.5, 14 => 1, 15 => 2, 16 => 4}
r = (site.map_stat.radius.to_f * zoomhash[@zoom.to_i].to_f).to_i
# title tooltip for the image
title = "%s %s => %s" % [@group.name, site.site_name,
(KeyWord.stat_description(site.status_sensor.last_value)[0])]
# create the icon image ( the pivot circle )
icon = GIcon.new(:image => "/images/tmp/#{site.id}.png",
:icon_size => GSize.new((r*2),(r*2)),
:icon_anchor => GPoint.new(r,r),
:info_window_anchor => GPoint.new(r,r))
# place the marker on the map
marker = GMarker.new([site.map_stat.lat.to_f ,
site.map_stat.long.to_f],
:title => title, :icon => icon, :info_window => text)
_all_markers[i] = marker
end
return _all_markers
end
def update_map_markers
@zoom = params[:zoom].to_i
@zoom = 14 if params[:zoom].nil?
@map = Variable.new("map")
@all_markers = Variable.new("myGroup") # the actual marker
group, not the markers, this is the container
@group.sites.each { |site| site.map_stat.circle_image(@zoom)}
@site_marks = make_map_markers(@group.sites, @zoom)
@marker = GMarker.new([75.89,-42.767],:title => "Update",
:info_window => "I have been placed through RJS")
end
I am using a simple form_remote_tag in the view, and in the rjs file i have
page << @map.clear_overlays
@site_marks.each {|mark| page << @map.add_overlay(mark)}
now, when i execute the button, the markers go away, but are not redrawn.
Anybody help me please ?
thanks again
shawn
From nephish at gmail.com Sat Mar 15 05:09:06 2008
From: nephish at gmail.com (shawn bright)
Date: Sat, 15 Mar 2008 04:09:06 -0500
Subject: [Ym4r-user] my keys to google maps api only work in webrick
Message-ID: <384c93600803150209s720faae3r327815b4b2f017b@mail.gmail.com>
Hey there all,. i am developing three sites that run on the same code,
just different logos, different companies, etc..
i have a config file that i believe is how it should be and it works
on webrick, but i get application errors when i try to move it to the
apache FCGI .
looks like this
development:
ABQIAAAA8GzGL0c5HitzfNKYM4nk_BQODDn4SSK1uiT7GyxROHR1XtTV_RTBQrvsTtfZDFeAH2vzkOtXunHV9g
test:
www.mydomain.com :
ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQaeqaw49lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w
www.myotherdomain.com :
ABQIAAAA8GzGL0c5HitzfNKYM4nk_BSx99h9tasdeYb1j2b-U66PBTfMSIiQIhjRfzcStCKrQcYDJnCCw
www.mythirddomain.com :
ABQIAAAA2ia3EuhQ0s_YuXVoYLIpURQxypaeasfwuc86W-RYF4VMBTVPXFhnHov2wbNF9ue4itpxH6g9A
production:
www.mydomain.com : :
ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0okdasadTFTjWleXY7LH-N3IAp9ruoqiU43w
www.myotherdomain.com :
ABQIAAAA8GzGL0c5HitzfNKYM4nk_BSx99h9t8Gp-7jw1NYb1j2b-U6asdfaIiQIhjRfzcStCKrQcYDJnCCw
www.mythirddomain..com :
ABQIAAAA2ia3EuhQ0s_YuXVoYLIpURQxypXxk2Sasdfe86W-RYF4VMBTVPXFhnHov2wbNF9ue4itpxH6g9A
if i run it in production mode i get application error.
if i run it in development mode, it tells me that this key is
registered to another website and i need to get an api key at
/google/apis/maps
webrick does everything right
any ideas?
thanks
From nephish at gmail.com Sat Mar 15 09:08:11 2008
From: nephish at gmail.com (shawn bright)
Date: Sat, 15 Mar 2008 08:08:11 -0500
Subject: [Ym4r-user] my keys to google maps api only work in webrick
In-Reply-To: <384c93600803150209s720faae3r327815b4b2f017b@mail.gmail.com>
References: <384c93600803150209s720faae3r327815b4b2f017b@mail.gmail.com>
Message-ID: <384c93600803150608m5e38d4efib96855c99e3a4e7c@mail.gmail.com>
another hint, the error in the production.log is
ActionView::TemplateError
(texaspivot.com,pivotrac.com,ontracbyreinke.com) on line #1 of
app/views/group/map_main_layout.rhtml:
1: <%= GMap.header %>
2:
3: <%= @map.to_html %>
4: <%= @map.div(:width => 1000, :height => 600) %>
hope this helps
shawn
On Sat, Mar 15, 2008 at 4:09 AM, shawn bright wrote:
> Hey there all,. i am developing three sites that run on the same code,
> just different logos, different companies, etc..
> i have a config file that i believe is how it should be and it works
> on webrick, but i get application errors when i try to move it to the
> apache FCGI .
>
> looks like this
>
> development:
> ABQIAAAA8GzGL0c5HitzfNKYM4nk_BQODDn4SSK1uiT7GyxROHR1XtTV_RTBQrvsTtfZDFeAH2vzkOtXunHV9g
>
> test:
> www.mydomain.com :
> ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQaeqaw49lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w
> www.myotherdomain.com :
> ABQIAAAA8GzGL0c5HitzfNKYM4nk_BSx99h9tasdeYb1j2b-U66PBTfMSIiQIhjRfzcStCKrQcYDJnCCw
> www.mythirddomain.com :
> ABQIAAAA2ia3EuhQ0s_YuXVoYLIpURQxypaeasfwuc86W-RYF4VMBTVPXFhnHov2wbNF9ue4itpxH6g9A
>
>
> production:
> www.mydomain.com : :
> ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0okdasadTFTjWleXY7LH-N3IAp9ruoqiU43w
> www.myotherdomain.com :
> ABQIAAAA8GzGL0c5HitzfNKYM4nk_BSx99h9t8Gp-7jw1NYb1j2b-U6asdfaIiQIhjRfzcStCKrQcYDJnCCw
> www.mythirddomain..com :
> ABQIAAAA2ia3EuhQ0s_YuXVoYLIpURQxypXxk2Sasdfe86W-RYF4VMBTVPXFhnHov2wbNF9ue4itpxH6g9A
>
> if i run it in production mode i get application error.
> if i run it in development mode, it tells me that this key is
> registered to another website and i need to get an api key at
> /google/apis/maps
> webrick does everything right
>
>
> any ideas?
>
> thanks
>
From nephish at gmail.com Sat Mar 15 18:19:20 2008
From: nephish at gmail.com (shawn bright)
Date: Sat, 15 Mar 2008 17:19:20 -0500
Subject: [Ym4r-user] problem with config file
Message-ID: <384c93600803151519l51edde96haa88e60ff274e5ae@mail.gmail.com>
Hey there all
if i have this in my gmap_api_key.yml file,
production:
ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w
everything works fine but if i have this .....
production:
texaspivot.com:
ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w
i get this
ActionView::TemplateError (texaspivot.com) on line #1 of
app/views/group/map_main_layout.rhtml:
i really need to be able to define three different domains for this...
I don't know what i am doing wrong, to me, looks just like the sample
file.
sorry so confused.
thanks for any tips
shawn
From ajturner at highearthorbit.com Sun Mar 16 16:50:47 2008
From: ajturner at highearthorbit.com (Andrew Turner)
Date: Sun, 16 Mar 2008 13:50:47 -0700
Subject: [Ym4r-user] problem with config file
In-Reply-To: <384c93600803151519l51edde96haa88e60ff274e5ae@mail.gmail.com>
References: <384c93600803151519l51edde96haa88e60ff274e5ae@mail.gmail.com>
Message-ID:
On Mar 15, 2008, at 3:19 PM, shawn bright wrote:
> Hey there all
>
> if i have this in my gmap_api_key.yml file,
> production:
>
> ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH
> -N3IAp9ruoqiU43w
>
> everything works fine but if i have this .....
>
>
> production:
> texaspivot.com:
> ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH
> -N3IAp9ruoqiU43w
>
The host needs to be on the same line as the key. It's just a YML file.
production:
texaspivot.com:
ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-
N3IAp9ruoqiU43w
>
> i get this
> ActionView::TemplateError (texaspivot.com) on line #1 of
> app/views/group/map_main_layout.rhtml:
>
> i really need to be able to define three different domains for this...
> I don't know what i am doing wrong, to me, looks just like the sample
> file.
> sorry so confused.
>
> thanks for any tips
>
> shawn
> _______________________________________________
> Ym4r-user mailing list
> Ym4r-user at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ym4r-user
From nephish at gmail.com Sun Mar 16 17:03:37 2008
From: nephish at gmail.com (shawn bright)
Date: Sun, 16 Mar 2008 16:03:37 -0500
Subject: [Ym4r-user] problem with config file
In-Reply-To:
References: <384c93600803151519l51edde96haa88e60ff274e5ae@mail.gmail.com>
Message-ID: <384c93600803161403h4293c13cw9cdc14dc6af6340@mail.gmail.com>
yes, sorry, it doesn't look the same in the email,
it is on the same line like
host: long_api_key
Thanks for looking at this
shawn
On Sun, Mar 16, 2008 at 3:50 PM, Andrew Turner
wrote:
> On Mar 15, 2008, at 3:19 PM, shawn bright wrote:
>
> > Hey there all
> >
> > if i have this in my gmap_api_key.yml file,
> > production:
> >
> > ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH
> > -N3IAp9ruoqiU43w
> >
> > everything works fine but if i have this .....
> >
> >
> > production:
> > texaspivot.com:
> > ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH
> > -N3IAp9ruoqiU43w
> >
>
> The host needs to be on the same line as the key. It's just a YML file.
>
>
> production:
> texaspivot.com:
> ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-
> N3IAp9ruoqiU43w
>
>
> >
> > i get this
> > ActionView::TemplateError (texaspivot.com) on line #1 of
> > app/views/group/map_main_layout.rhtml:
> >
> > i really need to be able to define three different domains for this...
> > I don't know what i am doing wrong, to me, looks just like the sample
> > file.
> > sorry so confused.
> >
> > thanks for any tips
> >
> > shawn
> > _______________________________________________
> > Ym4r-user mailing list
> > Ym4r-user at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/ym4r-user
>
>
From nephish at gmail.com Wed Mar 19 00:40:06 2008
From: nephish at gmail.com (shawn bright)
Date: Tue, 18 Mar 2008 23:40:06 -0500
Subject: [Ym4r-user] problem with config file
In-Reply-To: <384c93600803182107h74914015ud8cc9efd0970cf55@mail.gmail.com>
References: <384c93600803151519l51edde96haa88e60ff274e5ae@mail.gmail.com>
<4852.71.208.56.11.1205896886.squirrel@www.cora.nwra.com>
<384c93600803182107h74914015ud8cc9efd0970cf55@mail.gmail.com>
Message-ID: <384c93600803182140x42f710a7u78bd7433fc771c7b@mail.gmail.com>
ok, here is what i have in the config file
production:
ontracbyreinke.com :
ABQIAAAA8GzGL0c5HitzfNKYM4nk_BSx99h9t8Gp-7jw1NYb1j2b-U66PBTfMSIiQIhjRfzcStCKrQcYDJnCCw
texaspivot.com :
ABQIAAAA8GzGL0c5HitzfNKYM4nk_BQXfahRKLczKzlJSy9lXc0oaHHYcxSvrz5ukygFTClC-nd2KgrDl4c4Ag
pivotrac.com :
ABQIAAAA8GzGL0c5HitzfNKYM4nk_BSleyfwvKDtLQwce9fly5m8xgVM4BQ_4cWab-O_3H3qnPQ5oclpizLsFQ
thanks
On Tue, Mar 18, 2008 at 11:07 PM, shawn bright wrote:
> yes, i am hosting the same code for 3 different domains ( same code,
> different logos, etc.. )
> so i have under production
> production:
> texaspivot.com : KEY
> anotherdomain : KEY
> yetanotherdomain : KEY
>
>
>
> thanks for looking at this.
>
> shawn
>
>
>
> On Tue, Mar 18, 2008 at 10:21 PM, wrote:
> >
> > > everything works fine but if i have this .....
> > >
> > >
> > > production:
> > > texaspivot.com:
> > > ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w
> > >
> > > i get this
> > > ActionView::TemplateError (texaspivot.com) on line #1 of
> > > app/views/group/map_main_layout.rhtml:
> >
> > Have you tried putting in two or more entries?
> >
>