[Ym4r-user] Clusterer generating javascript syntax error

Guilhem Vellut guilhem.vellut at gmail.com
Thu Jan 18 14:43:56 EST 2007


Hello,

If you have installed the mapstraction plugin try again after having
uninstalled it.

guilhem

On 1/18/07, Joseph Dunn <joseph at magnesium.net> wrote:
>
> Hi all,
>
> I'm using Ym4r with the Clusterer. The GMaps code in my controller
> looks something like this:
>
>       # geo is an array of lon/lat points
>       session[:gmap] = GMap.new('map_div')
>       session[:gmap].control_init(:large_map => true,:map_type => true)
>       session[:gmap].center_zoom_init([38.134557,-95.537109],4)
>       markers = Array.new
>       geodata.each do |geo|
>         markers.push(GMarker.new([geo['lon'], geo['lat']],
> :info_window => "Hello", :title => "HOYOYO"))
>       end
>       clusterer = Clusterer.new(markers, :max_visible_markers => 2)
>       session[:gmap].overlay_init(clusterer)
>
> Then in my view I'm loading in the requisite javascript libraries,
> including clusterer and mapstraction, and then displaying the map with
> something like:
>
> <%= session[:gmap].div(:width => 600, :height => 400) %>
>
> However, I get this Javascript error when I view my page:
>
> illegal character
> 30map.setCenter(new
> GLatLng(38.134557,-95.537109
> ),4);map.addOverlay(#<Ym4r::MapstractionPlugin::Clusterer:0x9b3d608>);map.addControl(new
> GLargeMapControl());
>
> It seems pretty obvious that a Ruby object reference is somehow
> getting inserted into the generated Javascript. Removing the clusterer
> lines from my controller solves the problem. Any idea what's going on?
>
> Regards,
>
> Joseph
> _______________________________________________
> Ym4r-user mailing list
> Ym4r-user at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ym4r-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ym4r-user/attachments/20070118/fa22180c/attachment-0001.html 


More information about the Ym4r-user mailing list