<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>openlayers &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/openlayers/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>2xjQuery: Select a Selector</title>
		<link>/2010/09/24/2xjquery-select-a-selector/</link>
		<comments>/2010/09/24/2xjquery-select-a-selector/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 08:23:58 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Comparison of JavaScript frameworks]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery javascript library]]></category>
		<category><![CDATA[jquery selectors]]></category>
		<category><![CDATA[Markup languages]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[openlayers library]]></category>
		<category><![CDATA[Span and div]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">/?p=1989</guid>
		<description><![CDATA[Selectors in jQuery If you&#8217;re familiar with jQuery you should already know what are selectors and how they work. However we&#8217;re used to get some DOM element with a specific selector, but actually sometimes you cannot select directly what you need. This is especially true when mixing more than one JavaScript libraries. In my case &#8230; <a href="/2010/09/24/2xjquery-select-a-selector/" class="more-link">Continue reading <span class="screen-reader-text">2xjQuery: Select a Selector</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/01/08/jquery-vs-pure-javascript/" rel="bookmark" title="jQuery vs. pure JavaScript">jQuery vs. pure JavaScript </a></li>
<li><a href="/2009/07/29/cancel-bubbling-on-element-click-with-jquery/" rel="bookmark" title="cancel bubbling on element click with jQuery">cancel bubbling on element click with jQuery </a></li>
<li><a href="/2009/11/02/ajax-in-jquery/" rel="bookmark" title="$.ajax in jQuery">$.ajax in jQuery </a></li>
<li><a href="/2009/04/01/jquery-accessing-a-child-element/" rel="bookmark" title="jQuery &#8211; accessing a child element">jQuery &#8211; accessing a child element </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Selectors in jQuery</h2>
<p><a href="/wp-content/uploads/2010/09/jquery.png"><img class="alignleft size-full wp-image-1999" title="jquery" src="/wp-content/uploads/2010/09/jquery.png" alt="jQuery JavaScript Library" width="259" height="65" /></a></p>
<p>If you&#8217;re familiar with <a title="jQuery" href="http://jquery.com/" target="_blank">jQuery</a> you should already know what are selectors and how they work. However we&#8217;re used to get some DOM element with a specific selector, but actually sometimes you cannot select directly what you need. This is especially true when mixing more than one JavaScript libraries. In my case <a title="OpenLayers" href="http://openlayers.org/" target="_blank">OpenLayers</a> generated a vector layer and jQuery was supposed to change the vectors fill-color property.</p>
<p><a href="/wp-content/uploads/2010/09/openlayers.png"><img class="alignleft size-full wp-image-2000" title="openlayers" src="/wp-content/uploads/2010/09/openlayers.png" alt="OpenLayers" width="195" height="37" /></a></p>
<p>With the simple $(&#8216;path&#8217;) I easily got all vectors in the current document, but the problem was that I took them as text. Thus it came to me to use nested jQuery &#8211; $($(&#8216;selector&#8217;));</p>
<p>To describe what actually happened in my case, let me show you a breve example.</p>
<h2>Example</h2>
<p>Here&#8217;s a short HTML markup:</p>
<pre lang="html4strict">
<div><span>text text</span></div>

</pre>
<p>With jQuery I can select both the DIV and SPAN with the simple $(&#8216;div&#8217;) and $(&#8216;span&#8217;), but just for the example lets assume I&#8217;ve only the inner text of the DIV tag:</p>
<pre lang="javascript">$('div').html();
</pre>
<p>That was the case in the OpenLayers/jQuery problem. Now I can easily use another jQuery selector:</p>
<pre lang="javascript">$($('div').html());
</pre>
<p>This will return the same as $(&#8216;span&#8217;) &#8211; a jQuery object.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/01/08/jquery-vs-pure-javascript/" rel="bookmark" title="jQuery vs. pure JavaScript">jQuery vs. pure JavaScript </a></li>
<li><a href="/2009/07/29/cancel-bubbling-on-element-click-with-jquery/" rel="bookmark" title="cancel bubbling on element click with jQuery">cancel bubbling on element click with jQuery </a></li>
<li><a href="/2009/11/02/ajax-in-jquery/" rel="bookmark" title="$.ajax in jQuery">$.ajax in jQuery </a></li>
<li><a href="/2009/04/01/jquery-accessing-a-child-element/" rel="bookmark" title="jQuery &#8211; accessing a child element">jQuery &#8211; accessing a child element </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/09/24/2xjquery-select-a-selector/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenLayers Can Be Faster!</title>
		<link>/2010/03/19/openlayers-can-be-faster/</link>
		<comments>/2010/03/19/openlayers-can-be-faster/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 09:22:35 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Geography]]></category>
		<category><![CDATA[Keyhole Markup Language]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web mapping]]></category>

		<guid isPermaLink="false">/?p=1364</guid>
		<description><![CDATA[Put All The Markers at Once! The way OpenLayers puts markers on the stage is fine when they are not so much, but once you need more than 100, the library&#8217;s solution is not good. The question is is there a way to put all the markers faster than the built in method. Yes, There &#8230; <a href="/2010/03/19/openlayers-can-be-faster/" class="more-link">Continue reading <span class="screen-reader-text">OpenLayers Can Be Faster!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" rel="bookmark" title="OpenLayers extreme optimization. Cut, compress and deploy!">OpenLayers extreme optimization. Cut, compress and deploy! </a></li>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Put All The Markers at Once!</h2>
<p>The way OpenLayers puts markers on the stage is fine when they are not so much, but once you need more than 100, the library&#8217;s solution is not good. The question is is there a way to put all the markers faster than the built in method.</p>
<h2>Yes, There is a Way to Speed Up Markers Load</h2>
<p>I once wrote about how to speed up markers on <a title="OpenLayers" href="http://openlayers.org/" target="_blank">OpenLayers</a>, it is clear that my decision was to concatenate the DOM elements like a string after I&#8217;ve generated all the markers as markup with innerHTML as it&#8217;s faster than appendChild. The only question left is how to convert Longitude/Latitude pair in pixels.</p>
<h2>The Answer&#8217;s Given by OpenLayers</h2>
<p>There is a method called <strong>getLayerPxFromLonLat()</strong> which do the job. Let me show you a snippet:</p>
<pre lang="javascript">ll = map.getLayerPxFromLonLat(new OpenLayers.LonLat(lon,lat));
console.log(ll);</pre>
<p>You can see what&#8217;s inside the ll object. You can now reference the pixel as ll.y and ll.x.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" rel="bookmark" title="OpenLayers extreme optimization. Cut, compress and deploy!">OpenLayers extreme optimization. Cut, compress and deploy! </a></li>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/03/19/openlayers-can-be-faster/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Optimizing OpenLayers. Speed up markers load time!</title>
		<link>/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/</link>
		<comments>/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 07:03:08 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[appendChild]]></category>
		<category><![CDATA[marker]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">/?p=1051</guid>
		<description><![CDATA[Icons in OpenLayers! They chain of classes used to construct and make one single marker in OpenLayers is a bit difficult to follow, but isn&#8217;t impossible. There are three main classes in three files: Markers.js Layer/Markers.js Icon.js That&#8217;s why after tracking the code in them I noticed the library&#8217;s using appendChild in a line like &#8230; <a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" class="more-link">Continue reading <span class="screen-reader-text">Optimizing OpenLayers. Speed up markers load time!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" rel="bookmark" title="OpenLayers extreme optimization. Cut, compress and deploy!">OpenLayers extreme optimization. Cut, compress and deploy! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Icons in OpenLayers!</h2>
<p>They chain of classes used to construct and make one single marker in OpenLayers is a bit difficult to follow, but isn&#8217;t impossible. There are three main classes in three files:</p>
<pre lang="javascript">Markers.js
Layer/Markers.js
Icon.js</pre>
<p>That&#8217;s why after tracking the code in them I noticed the library&#8217;s using appendChild in a line like that:</p>
<pre lang="javascript">this.div.appendChild(markerImg);</pre>
<p>The problem is that if you&#8217;ve a loop with probably hundreds of iterations this is really slow. What I intent to do is to return only the generated code as string, or instead of returning the element, I can return the string. Than concatenate it after the loop&#8217;s over.</p>
<p>That will be way faster!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" rel="bookmark" title="OpenLayers extreme optimization. Cut, compress and deploy!">OpenLayers extreme optimization. Cut, compress and deploy! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>OpenLayers extreme optimization. Cut, compress and deploy!</title>
		<link>/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/</link>
		<comments>/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/#respond</comments>
		<pubDate>Mon, 08 Feb 2010 06:14:08 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Geography]]></category>
		<category><![CDATA[Keyhole Markup Language]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web mapping]]></category>

		<guid isPermaLink="false">/?p=1030</guid>
		<description><![CDATA[Make it really faster! Following several posts I wrote recently, this one will describe you a simple and robust tutorial how to optimize OpenLayers. My goal is pretty simple. I&#8217;d like smaller library but still with everything must work correctly. The fact is that OpenLayers comes with more that what I need so I&#8217;m going &#8230; <a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" class="more-link">Continue reading <span class="screen-reader-text">OpenLayers extreme optimization. Cut, compress and deploy!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Make it really faster!</h2>
<p>Following several posts I wrote recently, this one will describe you a simple and robust tutorial how to optimize <a href="http://openlayers.org/" target="_blank">OpenLayers</a>. My goal is pretty simple. I&#8217;d like smaller library but still with everything must work correctly. The fact is that OpenLayers comes with more that what I need so I&#8217;m going to exclude some files from the build process.</p>
<h2>Step 1</h2>
<p>This procedure I found <a href="http://www.geowebguru.com/articles/212-optimizing-openlayers" target="_blank">here</a>, and what I made is to copy/paste the whole list described there. The problem is that immediately the application stopped working, but in the same time I could catch what errors were stopping it and simply I was able to include again those files needed by my application.</p>
<h2>Step 2</h2>
<p>Even when I excluded everything from the library, there are some files I don&#8217;t need but that enter the resulting build. That&#8217;s because they depend on classes I need and the builder is simply adding them. The solution, even stupid enough, is to comment them all.</p>
<p>Note that on every step you need to check if the application is still fully functional. That&#8217;s a bit annoying, but it comes on the price of faster app.</p>
<h2>Step 3</h2>
<p>Change the compiler! Actually now OpenLayers is using JSMin, but I personally use Google Closure Compiler with it&#8217;s default level of optimization. Thus the resulting OpenLayers is 312K and still fully functional. After GZip it becomes even smaller and the load time is pretty good.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Closure Compiler?</title>
		<link>/2010/01/18/google-closure-compiler/</link>
		<comments>/2010/01/18/google-closure-compiler/#respond</comments>
		<pubDate>Mon, 18 Jan 2010 10:24:10 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[Googles]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Minification]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">/?p=897</guid>
		<description><![CDATA[Yes, it’s a question! After reading about jQuery version 1.4 I saw something that seemed to be pretty interesting to me. jQuery is now using Google Closure Compiler to minify and compile it’s source. The result was smaller output file. Now I’m using YUI Compressor for my project and when I decided to make an &#8230; <a href="/2010/01/18/google-closure-compiler/" class="more-link">Continue reading <span class="screen-reader-text">Google Closure Compiler?</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/01/20/google-closure-compiler-doesnt-work/" rel="bookmark" title="Google Closure Compiler doesn&#8217;t work?!">Google Closure Compiler doesn&#8217;t work?! </a></li>
<li><a href="/2010/01/08/jquery-vs-pure-javascript/" rel="bookmark" title="jQuery vs. pure JavaScript">jQuery vs. pure JavaScript </a></li>
<li><a href="/2009/03/19/jquery-ui/" rel="bookmark" title="JQuery UI">JQuery UI </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Yes, it’s a question! After reading about jQuery version 1.4 I saw something that seemed to be pretty interesting to me. jQuery is now using Google Closure Compiler to minify and compile it’s source. The result was smaller output file.</p>
<p>Now I’m using YUI Compressor for my project and when I decided to make an experiment with Googles’ software it was just because I’d like to gain loading savings. In the project I’m working on I use two famous JavaScript libraries: jQuery and OpenLayers, and the result was really good. The compiled code was smaller than the YUI compressed source and the savings where more than 50% for non-gzipped requests.</p>
<p>The problem is that the resulting code, even successfully compiled after what Google said, was producing errors on the site and wasn’t working correctly. That why I’m leaving the title as a question and I’ll continue my experiments with this approach until I get any good results.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/01/20/google-closure-compiler-doesnt-work/" rel="bookmark" title="Google Closure Compiler doesn&#8217;t work?!">Google Closure Compiler doesn&#8217;t work?! </a></li>
<li><a href="/2010/01/08/jquery-vs-pure-javascript/" rel="bookmark" title="jQuery vs. pure JavaScript">jQuery vs. pure JavaScript </a></li>
<li><a href="/2009/03/19/jquery-ui/" rel="bookmark" title="JQuery UI">JQuery UI </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/01/18/google-closure-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing OpenLayers. Make it smaller and faster!</title>
		<link>/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/</link>
		<comments>/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 08:17:53 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[JavaScript library]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[so many protocols]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">/?p=876</guid>
		<description><![CDATA[In breve OpenLayers is a open javascript library that gives you the power to integrate, work and develop map based web applications as is Google Maps. The problem is that the library supports so many protocols, controls and tools that you probably never use in your application and because of this the size of the &#8230; <a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" class="more-link">Continue reading <span class="screen-reader-text">Optimizing OpenLayers. Make it smaller and faster!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>In breve OpenLayers is a open javascript library that gives you the power to integrate, work and develop map based web applications as is Google Maps.</p>
<p>The problem is that the library supports so many protocols, controls and tools that you probably never use in your application and because of this the size of the resulting, compressed javascript file is around 700K, which is too big for any javascript file at all. That makes your site slow and the user experience is really awful!</p>
<p>The solution is to cut that functionality that you don’t use, which is not so easy. You’ve to be careful doing this, just because you can crash you application by removing something that seems to be useless but in fact isn’t.</p>
<p>I’ve used this technique and managed to make the resulting javascript file up to 400K. And this is really simple &#8211; just add the files your application don’t need to the .cfg file you use for compression. Usually this fils is in the /build directory of OpenLayers.</p>
<p>Even more &#8211; I’ve seen some other developers managing to reduce the size up to 300K and that’s more than twice which is really very good result.</p>
<p>The other thing I’d like to do with that library is to explore with care the code inside and to optimize anything I can. There are too many style reflows in some classes and that’s what’s visible on the first look. I suppose there are much more things to optimized in it.</p>
<p>I’ll start doing my research and optimization and I’ll let you know what happens in numbers!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenLayers vectors IE bug!</title>
		<link>/2009/08/06/openlayers-vectors-ie-bug/</link>
		<comments>/2009/08/06/openlayers-vectors-ie-bug/#respond</comments>
		<pubDate>Thu, 06 Aug 2009 06:55:19 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[openstreetmap]]></category>
		<category><![CDATA[vector]]></category>
		<category><![CDATA[VML]]></category>

		<guid isPermaLink="false">/?p=721</guid>
		<description><![CDATA[OpenLayers and OpenStreetMap If you&#8217;re not familiar with OpenLayers library, in breve this is a JavaScript library which interacts with a tile server such as this of OpenStreetMap.org Vectors Because it&#8217;s JavaScript OpenLayers library it renders different types of vectors when it becomes the case of vectors. It tries the VML way, but as you &#8230; <a href="/2009/08/06/openlayers-vectors-ie-bug/" class="more-link">Continue reading <span class="screen-reader-text">OpenLayers vectors IE bug!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
<li><a href="/2010/09/24/2xjquery-select-a-selector/" rel="bookmark" title="2xjQuery: Select a Selector">2xjQuery: Select a Selector </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>OpenLayers and OpenStreetMap</h2>
<p>If you&#8217;re not familiar with <a title="OpenLayers" href="http://www.openlayers.org/" target="_blank">OpenLayers</a> library, in breve this is a JavaScript library which interacts with a tile server such as this of <a title="openstreetmap" href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap.org</a></p>
<p><a href="/wp-content/uploads/2009/08/open-street-map.png"><img class="alignnone size-full wp-image-722" title="open-street-map" src="/wp-content/uploads/2009/08/open-street-map.png" alt="" width="430" height="276" srcset="/wp-content/uploads/2009/08/open-street-map.png 430w, /wp-content/uploads/2009/08/open-street-map-300x192.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></a></p>
<h2>Vectors</h2>
<p>Because it&#8217;s JavaScript OpenLayers library it renders different types of vectors when it becomes the case of vectors. It tries the VML way, but as you may know not every browser support it.  Actually everything works fine in every browser, and that&#8217;s the good part of OpenLayers, which is one of the best JavaScript organized project I&#8217;ve worked with.</p>
<p><img class="alignnone size-full wp-image-723" title="openlayers-vectors" src="/wp-content/uploads/2009/08/openlayers-vectors.png" alt="" width="430" height="253" srcset="/wp-content/uploads/2009/08/openlayers-vectors.png 430w, /wp-content/uploads/2009/08/openlayers-vectors-300x176.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></p>
<p>The problem is that if you&#8217;ve something in the DOM with z-index over the vector layer IE&#8217;s giving problems because as it appears it cannot be rendered.</p>
<blockquote><p>The solution is to draw the layer but skip the .addLayer before the vectors should be seen. You than remove the DOM element, which is over the vector layer you set .setVisibility(true) and the layer appears on the stage.</p>
<p>So far this is the only solution I got, but there may be others.</p></blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" rel="bookmark" title="OpenLayers disable mouse wheel on zoom">OpenLayers disable mouse wheel on zoom </a></li>
<li><a href="/2010/09/24/2xjquery-select-a-selector/" rel="bookmark" title="2xjQuery: Select a Selector">2xjQuery: Select a Selector </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/08/06/openlayers-vectors-ie-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenLayers disable mouse wheel on zoom</title>
		<link>/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/</link>
		<comments>/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 06:29:49 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[mouse wheel]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[OpenLayers.Control.Navigation]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">/?p=603</guid>
		<description><![CDATA[What is OpenLayers? OpenLayers is a open source JavaScript library, which helps for the usage and development of web based map applications. Usually when you use something like http://openstreetmap.org/ you&#8217;ve a tile server, which contains, or dynamically, renders tiles on a specific coordinates and zoom level. Such application in basic are most of the map &#8230; <a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" class="more-link">Continue reading <span class="screen-reader-text">OpenLayers disable mouse wheel on zoom</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/07/14/openlayers-disable-dragging/" rel="bookmark" title="OpenLayers disable dragging">OpenLayers disable dragging </a></li>
<li><a href="/2009/07/01/javascript-disable-mouse-wheel/" rel="bookmark" title="JavaScript disable mouse wheel">JavaScript disable mouse wheel </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>What is OpenLayers?</h2>
<p>OpenLayers is a open source JavaScript library, which helps for the usage and development of web based map applications. Usually when you use something like <a title="Open Street Map" href="http://openstreetmap.org/" target="_blank">http://openstreetmap.org/</a> you&#8217;ve a tile server, which contains, or dynamically, renders tiles on a specific coordinates and zoom level. Such application in basic are most of the map servers you may know, as Google, Yahoo and Live (now Bing). Than you need a layer above that, that must generate the correct HTTP queries to the server and after receiving the tiles to position them correctly. Of course a open library like OpenLayers do much more. In fact this is complex JavaScript application that gives enough flexability to manipulate rich map applications.</p>
<h2>How to disable the zoom with the mouse wheel</h2>
<p>Very common problem (if we can say so) in map sites is the scroll, cause sometimes the user wants to scroll the page, and sometimes to scroll the map, which action results in zooming the map. Yes, there are so many solutions as many are the combinations of those scenarios. But the case here was how to disable the mouse wheel on OpenLayers.<span id="more-603"></span></p>
<h2>Why it&#8217;s not working</h2>
<p>Described in the documentation as a simple task, it appears to be not so much! Following the official instructions, you must add those lines of code:<em></em></p>
<pre lang="javascript">var movemap = new OpenLayers.Control.Navigation({'zoomWheelEnabled': false});

movemap.disableZoomWheel();</pre>
<p>&#8230; but that&#8217;s not working.</p>
<h2>How to make it really work</h2>
<p>Actually something&#8217;s blocking the effect of disableZoomWheel in the chain of the Control class, so the solution is as simple as it&#8217;s:</p>
<pre lang="javascript">controls = map.getControlsByClass('OpenLayers.Control.Navigation');

for(var I = 0; i < controls.length; ++i)
     controls.disableZoomWheel();
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/07/14/openlayers-disable-dragging/" rel="bookmark" title="OpenLayers disable dragging">OpenLayers disable dragging </a></li>
<li><a href="/2009/07/01/javascript-disable-mouse-wheel/" rel="bookmark" title="JavaScript disable mouse wheel">JavaScript disable mouse wheel </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
