<?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: OpenLayers Tutorial &#8211; Part 2 &#8211; Layers</title>
	<atom:link href="http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/feed/" rel="self" type="application/rss+xml" />
	<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/</link>
	<description>Erik Hazzard&#039;s various thoughts and ramblings</description>
	<lastBuildDate>Wed, 01 Sep 2010 02:25:57 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steven</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-2950</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Fri, 16 Apr 2010 19:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-2950</guid>
		<description>Thanks for the tutorials.

I&#039;m trying some different wms servers but I can&#039;t get it to work.

For example this one, 

my script looks like this:
function init() {
	map = new OpenLayers.Map(&#039;map&#039;);
	var wms = new OpenLayers.Layer.WMS(
		&quot;OpenLayers WMS&quot;,
		&quot;http://disc1.sci.gsfc.nasa.gov/daac-bin/wms_airsnrt/GES_DISC_WMS_AIRS&quot;,
		{layers: &#039;coastline&#039;}
	);

	map.addLayers([wms]);
	map.zoomToMaxExtent();
}

What am I doing wrong?</description>
		<content:encoded><![CDATA[<p>Thanks for the tutorials.</p>
<p>I&#8217;m trying some different wms servers but I can&#8217;t get it to work.</p>
<p>For example this one, </p>
<p>my script looks like this:<br />
function init() {<br />
	map = new OpenLayers.Map(&#8216;map&#8217;);<br />
	var wms = new OpenLayers.Layer.WMS(<br />
		&#8220;OpenLayers WMS&#8221;,<br />
		&#8220;http://disc1.sci.gsfc.nasa.gov/daac-bin/wms_airsnrt/GES_DISC_WMS_AIRS&#8221;,<br />
		{layers: &#8216;coastline&#8217;}<br />
	);</p>
<p>	map.addLayers([wms]);<br />
	map.zoomToMaxExtent();<br />
}</p>
<p>What am I doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-2040</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 26 Feb 2010 10:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-2040</guid>
		<description>Sorry for the post above.
I&#039;ve found the way. It works with map.setCenter but not with map.zoomTo
Thanks for your help.

Andy</description>
		<content:encoded><![CDATA[<p>Sorry for the post above.<br />
I&#8217;ve found the way. It works with map.setCenter but not with map.zoomTo<br />
Thanks for your help.</p>
<p>Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-2039</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 26 Feb 2010 10:00:46 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-2039</guid>
		<description>Thank you for your answer but it does not solve my problem.
The only thing that changes is that now I don&#039;t even see the map.
I realy can&#039;t figure out this zoom thing. Everything I do except for the map.zoomToMaxExtent(); returns an empty website.

Andy</description>
		<content:encoded><![CDATA[<p>Thank you for your answer but it does not solve my problem.<br />
The only thing that changes is that now I don&#8217;t even see the map.<br />
I realy can&#8217;t figure out this zoom thing. Everything I do except for the map.zoomToMaxExtent(); returns an empty website.</p>
<p>Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hazzard</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-2004</link>
		<dc:creator>Erik Hazzard</dc:creator>
		<pubDate>Wed, 24 Feb 2010 20:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-2004</guid>
		<description>Hi Andy, 
Thanks for the compliments!

There are a few ways to accomplish this.  The quickest way I think to do it would be to use the map.zoomTo(zoom_level); function call to zoom to a specific zoom level.  e.g.
&lt;code&gt;
map.zoomToMaxExtent();
map.zoomTo(4);
&lt;/code&gt;
Where 4 is the zoom level you want.  

You could also use map.setCenter(lonlat, zoom_level); if you know the lon and lat of where you want the center point to be, e.g.
&lt;code&gt;
map.setCenter(new OpenLayers.LonLat(42,42), 4);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Andy,<br />
Thanks for the compliments!</p>
<p>There are a few ways to accomplish this.  The quickest way I think to do it would be to use the map.zoomTo(zoom_level); function call to zoom to a specific zoom level.  e.g.<br />
<code><br />
map.zoomToMaxExtent();<br />
map.zoomTo(4);<br />
</code><br />
Where 4 is the zoom level you want.  </p>
<p>You could also use map.setCenter(lonlat, zoom_level); if you know the lon and lat of where you want the center point to be, e.g.<br />
<code><br />
map.setCenter(new OpenLayers.LonLat(42,42), 4);<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-1975</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Tue, 23 Feb 2010 12:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-1975</guid>
		<description>Hi,
I am experiencing some problems with openlayers myself. I realy don&#039;t know how to set the starting zoom for the map. If I only say map.zoomToMaxExtent(); the map is so small that I can barely see it. Any advices?
Great tutorials by the way, looking forward to new parts.

Thank you,
Andy</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am experiencing some problems with openlayers myself. I realy don&#8217;t know how to set the starting zoom for the map. If I only say map.zoomToMaxExtent(); the map is so small that I can barely see it. Any advices?<br />
Great tutorials by the way, looking forward to new parts.</p>
<p>Thank you,<br />
Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alfonse</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-1856</link>
		<dc:creator>Alfonse</dc:creator>
		<pubDate>Thu, 18 Feb 2010 15:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-1856</guid>
		<description>Jeez Erik...somehow, I missed your response. Thanks for the help and for creating the map example for me. Interestingly, we are about to implement layers with styles so, your response couldn&#039;t be more timely. 

Thanks again,
Al</description>
		<content:encoded><![CDATA[<p>Jeez Erik&#8230;somehow, I missed your response. Thanks for the help and for creating the map example for me. Interestingly, we are about to implement layers with styles so, your response couldn&#8217;t be more timely. </p>
<p>Thanks again,<br />
Al</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hazzard</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-1339</link>
		<dc:creator>Erik Hazzard</dc:creator>
		<pubDate>Sat, 16 Jan 2010 22:53:27 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-1339</guid>
		<description>Hi Tracy, thanks for the compliment! :)  I&#039;m finalizing a couple more of the tutorials, your feedback encouraged me to do it quicker - I plan to post an add on to the second tutorial and tutorial number 3 within the next few days.
-Erik</description>
		<content:encoded><![CDATA[<p>Hi Tracy, thanks for the compliment! <img src='http://vasir.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I&#8217;m finalizing a couple more of the tutorials, your feedback encouraged me to do it quicker &#8211; I plan to post an add on to the second tutorial and tutorial number 3 within the next few days.<br />
-Erik</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tracy</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-1338</link>
		<dc:creator>tracy</dc:creator>
		<pubDate>Sat, 16 Jan 2010 18:30:47 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-1338</guid>
		<description>Hi Erik,
I was loving your first 2 tutorials - they really took the mystery out of all of this and made me realize that OpenLayers is not way out of my league. How long do we have to wait for the rest? :)
Cheers &amp; thank you!</description>
		<content:encoded><![CDATA[<p>Hi Erik,<br />
I was loving your first 2 tutorials &#8211; they really took the mystery out of all of this and made me realize that OpenLayers is not way out of my league. How long do we have to wait for the rest? <img src='http://vasir.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Cheers &amp; thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hazzard</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-486</link>
		<dc:creator>Erik Hazzard</dc:creator>
		<pubDate>Fri, 04 Dec 2009 23:43:45 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-486</guid>
		<description>Hey Alfonse - sorry for the delay.  You can pass the STYLES parameter like you can any other URL parameter (e.g., LAYERS, FORMAT, etc.)
Specifically:
&lt;pre lang=&quot;javascript&quot;&gt;
map = new OpenLayers.Map(&#039;map&#039;);
    var wms = new OpenLayers.Layer.WMS(
    &quot;Alfonse&#039;s OpenLayers WMS&quot;,
    &quot;http://sedac.ciesin.columbia.edu/mapserver/wfs/ESI2005&quot;,
    {layers: &#039;esi2005&#039;,
      styles: &quot;urban_nitrogen_dioxide_concentration&quot;,
    }
    );
     
    map.addLayers([wms]);
    map.zoomToMaxExtent();
&lt;/pre&gt;


You can pass whatever STYLE you want - it could be
&lt;code&gt; styles: &quot;urban_nitrogen_dioxide_concentration&quot; &lt;/code&gt; for what you requested, but you can put in whatever string that is support in the GetCapabilities call.  

&lt;br /&gt;&lt;br /&gt;For example, &lt;code&gt;styles: &quot;researchers_per_million_inhabitants&quot;&lt;/code&gt; works just as well

I made an example demonstrating switching styles &lt;a href=&quot;http://vasir.net/~erik/examples/alfonse.html&quot; rel=&quot;nofollow&quot;&gt;http://vasir.net/~erik/examples/alfonse.html&lt;/a&gt;
cheers</description>
		<content:encoded><![CDATA[<p>Hey Alfonse &#8211; sorry for the delay.  You can pass the STYLES parameter like you can any other URL parameter (e.g., LAYERS, FORMAT, etc.)<br />
Specifically:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'map'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> wms <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">WMS</span><span style="color: #009900;">&#40;</span>
    <span style="color: #3366CC;">&quot;Alfonse's OpenLayers WMS&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;http://sedac.ciesin.columbia.edu/mapserver/wfs/ESI2005&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span>layers<span style="color: #339933;">:</span> <span style="color: #3366CC;">'esi2005'</span><span style="color: #339933;">,</span>
      styles<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;urban_nitrogen_dioxide_concentration&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    map.<span style="color: #660066;">addLayers</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>wms<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    map.<span style="color: #660066;">zoomToMaxExtent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can pass whatever STYLE you want &#8211; it could be<br />
<code> styles: "urban_nitrogen_dioxide_concentration" </code> for what you requested, but you can put in whatever string that is support in the GetCapabilities call.  </p>
<p>For example, <code>styles: "researchers_per_million_inhabitants"</code> works just as well</p>
<p>I made an example demonstrating switching styles <a href="http://vasir.net/~erik/examples/alfonse.html" rel="nofollow">http://vasir.net/~erik/examples/alfonse.html</a><br />
cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alfonse</title>
		<link>http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/comment-page-1/#comment-339</link>
		<dc:creator>Alfonse</dc:creator>
		<pubDate>Tue, 24 Nov 2009 14:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://vasir.net/blog/?p=85#comment-339</guid>
		<description>Thanks for the tutorial.  I was wondering if you knew of a way to handle and display the &#039;Styles&#039; parameter of a GetCapabilities request. For example, take a look at this GetCapabilities request: 

http://sedac.ciesin.columbia.edu/mapserver/wfs/ESI2005?LAYERS=esi2005&amp;FORMAT=image/png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=urban_nitrogen_dioxide_concentration&amp;SRS=EPSG:4326&amp;BBOX=-179,-90,179,90&amp;WIDTH=640&amp;HEIGHT=380

How would I display the &quot;STYLES=urban_nitrogen_dioxide_concentration&quot; in an OpenLayers map?

Any help would greatly be appreciated. Thanks</description>
		<content:encoded><![CDATA[<p>Thanks for the tutorial.  I was wondering if you knew of a way to handle and display the &#8216;Styles&#8217; parameter of a GetCapabilities request. For example, take a look at this GetCapabilities request: </p>
<p><a href="http://sedac.ciesin.columbia.edu/mapserver/wfs/ESI2005?LAYERS=esi2005&amp;FORMAT=image/png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=urban_nitrogen_dioxide_concentration&amp;SRS=EPSG:4326&amp;BBOX=-179,-90,179,90&amp;WIDTH=640&amp;HEIGHT=380" rel="nofollow">http://sedac.ciesin.columbia.edu/mapserver/wfs/ESI2005?LAYERS=esi2005&amp;FORMAT=image/png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=urban_nitrogen_dioxide_concentration&amp;SRS=EPSG:4326&amp;BBOX=-179,-90,179,90&amp;WIDTH=640&amp;HEIGHT=380</a></p>
<p>How would I display the &#8220;STYLES=urban_nitrogen_dioxide_concentration&#8221; in an OpenLayers map?</p>
<p>Any help would greatly be appreciated. Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
