<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - how to show different markers for current location and nearby locatio]]></title>
		<link>http://railsforum.com/viewtopic.php?id=52015</link>
		<description><![CDATA[The most recent posts in how to show different markers for current location and nearby locatio.]]></description>
		<lastBuildDate>Wed, 16 Jan 2013 12:16:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[how to show different markers for current location and nearby locatio]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=158352#p158352</link>
			<description><![CDATA[<p>Hai guys,</p><p>Iam using gmaps4rails to show gmaps in my application.iam getting the map pointa right but iam unable to differentiate the current location and nerby locations in my map.my idea&nbsp; is to use different markers for two locations i did it in the following way but it didnt worked for me</p><p>my controller</p><p>def profile<br />&nbsp; &nbsp;@googlemaplocation=Location.<br />find_by_id(&quot;#{params[:clinic_id]}&quot;)<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; @json1 = @googlemaplocation.to_gmaps4rails do |locations, marker|</p><p>&nbsp; marker.picture({<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :picture =&gt; &quot;<a href="http://www.google.com/mapfiles/dd-start.png">http://www.google.com/mapfiles/dd-start.png</a>&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :width&nbsp; &nbsp;=&gt; 32,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :height&nbsp; =&gt; 32<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;})<br />&nbsp; end</p><p>&nbsp; &nbsp; @neargooglemaplocation=@googlemaplocation.nearbys(10)<br />&nbsp; &nbsp; @json2= @neargooglemaplocation.to_gmaps4rails do |locations, marker|</p><p>&nbsp; marker.picture({<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :picture =&gt; &quot;<a href="http://www.google.com/mapfiles/dd-start.png">http://www.google.com/mapfiles/dd-start.png</a>&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :width&nbsp; &nbsp;=&gt; 32,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :height&nbsp; =&gt; 32<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;})<br />&nbsp; end<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; @json = (JSON.parse(@json1) + JSON.parse(@json2)).to_json<br />&nbsp; &nbsp;<br />&nbsp; end</p><p>my view</p><p> &lt;%= gmaps(:markers =&gt; { :data =&gt; @json } ) %&gt;</p><p>what should i do if i want to display two different markers on the same map</p><p>Thanks &amp; Regards<br />Hari Krishna</p>]]></description>
			<author><![CDATA[dummy@example.com (hari1659)]]></author>
			<pubDate>Wed, 16 Jan 2013 12:16:59 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=158352#p158352</guid>
		</item>
	</channel>
</rss>
