<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Geocoding with Google Maps and the Zend Framework</title>
	<atom:link href="http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/</link>
	<description></description>
	<lastBuildDate>Fri, 28 Jan 2011 04:42:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Canli Yayin</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-360</link>
		<dc:creator>Canli Yayin</dc:creator>
		<pubDate>Fri, 28 Jan 2011 03:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-360</guid>
		<description>One of my best articles i have read at last days. thank you dude....</description>
		<content:encoded><![CDATA[<p>One of my best articles i have read at last days. thank you dude&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-357</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Sat, 08 Jan 2011 03:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-357</guid>
		<description>Hello again, Patrick,

I don&#039;t know if I updated and forgot since I read this comment last but that return statement is fixed. The syntaxhighlighting plugin I have been using keeps messing up my code and escaping the HTML characters. I am pretty sure all of the places that the code was being escaped have been fixed.</description>
		<content:encoded><![CDATA[<p>Hello again, Patrick,</p>
<p>I don&#8217;t know if I updated and forgot since I read this comment last but that return statement is fixed. The syntaxhighlighting plugin I have been using keeps messing up my code and escaping the HTML characters. I am pretty sure all of the places that the code was being escaped have been fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-356</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Sat, 08 Jan 2011 03:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-356</guid>
		<description>Hi Patrick, sorry for the delay in response. You are absolutely right, I updated the code example to reflect best practices.</description>
		<content:encoded><![CDATA[<p>Hi Patrick, sorry for the delay in response. You are absolutely right, I updated the code example to reflect best practices.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Bielen</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-352</link>
		<dc:creator>Patrick Bielen</dc:creator>
		<pubDate>Sat, 11 Dec 2010 10:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-352</guid>
		<description>Your public function getCoordinates seems not to be correct...

$return(
&#039;lat&#039; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[1];
&#039;lon&#039; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[0];
);

is no valid php code... so i guess that has to be...

$return = array(
&#039;lat&#039; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[1],
&#039;lon&#039; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[0]
);

If that is correct you can also avoid the $return = array(); a few lines above, as $return is always initialised in the in the if-then construction.

Best Regards,

Patrick</description>
		<content:encoded><![CDATA[<p>Your public function getCoordinates seems not to be correct&#8230;</p>
<p>$return(<br />
&#8216;lat&#8217; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[1];<br />
&#8216;lon&#8217; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[0];<br />
);</p>
<p>is no valid php code&#8230; so i guess that has to be&#8230;</p>
<p>$return = array(<br />
&#8216;lat&#8217; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[1],<br />
&#8216;lon&#8217; =&gt; $result-&gt;Placemark[0]-&gt;Point-&gt;coordinates[0]<br />
);</p>
<p>If that is correct you can also avoid the $return = array(); a few lines above, as $return is always initialised in the in the if-then construction.</p>
<p>Best Regards,</p>
<p>Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Bielen</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-351</link>
		<dc:creator>Patrick Bielen</dc:creator>
		<pubDate>Sat, 11 Dec 2010 09:58:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-351</guid>
		<description>Hi Rob,

Why are you using index.php tot put the key to the registry ?
Isn&#039;t it better to for example use the bootstrap file ?
Like this for example ?

protected function _initGoogleMapsKey()
{
    defined(&#039;CONFIG_PATH&#039;) 
    or define(&#039;CONFIG_PATH&#039;, APPLICATION_PATH . &#039;/configs/application.ini&#039;);
    Zend_Registry::set(&#039;google&#039;,    new Zend_Config_Ini(CONFIG_PATH, &#039;google&#039;));
}

I think this is best practice to configure the google maps key, as normally you do not touch index.php at all, or you should want to use another google framework version, which you can config in the index.php.

Best Regards,

Patrick</description>
		<content:encoded><![CDATA[<p>Hi Rob,</p>
<p>Why are you using index.php tot put the key to the registry ?<br />
Isn&#8217;t it better to for example use the bootstrap file ?<br />
Like this for example ?</p>
<p>protected function _initGoogleMapsKey()<br />
{<br />
    defined(&#8216;CONFIG_PATH&#8217;)<br />
    or define(&#8216;CONFIG_PATH&#8217;, APPLICATION_PATH . &#8216;/configs/application.ini&#8217;);<br />
    Zend_Registry::set(&#8216;google&#8217;,    new Zend_Config_Ini(CONFIG_PATH, &#8216;google&#8217;));<br />
}</p>
<p>I think this is best practice to configure the google maps key, as normally you do not touch index.php at all, or you should want to use another google framework version, which you can config in the index.php.</p>
<p>Best Regards,</p>
<p>Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-216</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Sun, 09 May 2010 19:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-216</guid>
		<description>Hi Shaun, thanks for the input. You are correct, an adapter would be overkill. I am not quite sure why I put &quot;Adapter&quot; in there, as it is really meant to be used as a model, the references have been fixed to be Geocoder. 

If I&#039;m not mistaken, the only change you&#039;ve proposed is moving the code to a &quot;Service&quot; class, as I am already making use of Zend_Http in pretty much the exact same way. By having this logic in a model, I am able to have utility methods and expose more methods without fudging the purpose of the class. In reality, it makes the most sense to incorporate both approaches, and retrieve the data for my Geocoder model from a Services class. 

It&#039;s not about the amount of work I need to do get lat and lon, I can reuse this class as many times as I want. It is more about providing a clean and intuitive interface to gathering geodata.

Cheers</description>
		<content:encoded><![CDATA[<p>Hi Shaun, thanks for the input. You are correct, an adapter would be overkill. I am not quite sure why I put &#8220;Adapter&#8221; in there, as it is really meant to be used as a model, the references have been fixed to be Geocoder. </p>
<p>If I&#8217;m not mistaken, the only change you&#8217;ve proposed is moving the code to a &#8220;Service&#8221; class, as I am already making use of Zend_Http in pretty much the exact same way. By having this logic in a model, I am able to have utility methods and expose more methods without fudging the purpose of the class. In reality, it makes the most sense to incorporate both approaches, and retrieve the data for my Geocoder model from a Services class. </p>
<p>It&#8217;s not about the amount of work I need to do get lat and lon, I can reuse this class as many times as I want. It is more about providing a clean and intuitive interface to gathering geodata.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaun Farrell</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-214</link>
		<dc:creator>Shaun Farrell</dc:creator>
		<pubDate>Sun, 09 May 2010 11:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-214</guid>
		<description>Another way to do this is to store your key in the config then just load the key out of the config via your bootstrap and set it in the registry.  

Then create a Service class in your custom library. and use Zend_Http
&lt;code&gt;
		$this-&gt;_httpClient-&gt;setUri(&quot;http://maps.google.com/maps/geo&quot;);
        $this-&gt;_httpClient-&gt;setHeaders(&#039;Accept-Charset&#039;, &#039;ISO-8859-1,utf-8&#039;);
		$this-&gt;_httpClient-&gt;setParameterGet(array(
			&#039;key&#039; =&gt; $this-&gt;_key,
			&#039;output&#039; =&gt; $this-&gt;_output,
			&#039;q&#039; =&gt; $address,
		));
		$data = $this-&gt;_httpClient-&gt;request(&#039;GET&#039;);
		return $data-&gt;getBody();
&lt;/code&gt;

An adapter seems like a lot of work to get a lat long.</description>
		<content:encoded><![CDATA[<p>Another way to do this is to store your key in the config then just load the key out of the config via your bootstrap and set it in the registry.  </p>
<p>Then create a Service class in your custom library. and use Zend_Http<br />
<code><br />
		$this-&gt;_httpClient-&gt;setUri("http://maps.google.com/maps/geo");<br />
        $this-&gt;_httpClient-&gt;setHeaders('Accept-Charset', 'ISO-8859-1,utf-8');<br />
		$this-&gt;_httpClient-&gt;setParameterGet(array(<br />
			'key' =&gt; $this-&gt;_key,<br />
			'output' =&gt; $this-&gt;_output,<br />
			'q' =&gt; $address,<br />
		));<br />
		$data = $this-&gt;_httpClient-&gt;request('GET');<br />
		return $data-&gt;getBody();<br />
</code></p>
<p>An adapter seems like a lot of work to get a lat long.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Altoff</title>
		<link>http://www.bitconsultants.net/2010/geocoding-with-google-maps-and-the-zend-framework/comment-page-1/#comment-151</link>
		<dc:creator>Jim Altoff</dc:creator>
		<pubDate>Sat, 01 May 2010 05:51:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.bitconsultants.net/?p=231#comment-151</guid>
		<description>Thanks for this! I was trying to figure out how to work the Google Maps API into a Zend project and was not having much luck. The custom icon is cool too!

Thanks again!

-Jim</description>
		<content:encoded><![CDATA[<p>Thanks for this! I was trying to figure out how to work the Google Maps API into a Zend project and was not having much luck. The custom icon is cool too!</p>
<p>Thanks again!</p>
<p>-Jim</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using xcache
Page Caching using xcache
Object Caching 376/407 objects using memcached

Served from: www.bitconsultants.net @ 2012-02-05 16:25:14 -->
