<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<font style="font-size:10pt;" face="Arial" color="#366092" size="2">thanks for the answer Matt, OpenGSC and Diego, I'll check the links and see what is going on there<br><br>Regards,<br></font><br><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Wed, 12 Dec 2012 12:11:01 -0600<br>From: mpriour@kestrelcomputer.com<br>To: openlayers-users@lists.osgeo.org<br>Subject: Re: [OpenLayers-Users] vector doesn't display<br><br>
You have to actually load the GeoJSON features into the layer.<br>
<br>
First, look at the following examples:<br>
<br>
<a class="ecxmoz-txt-link-freetext" href="http://openlayers.org/dev/examples/geojson-reprojected.html" target="_blank">http://openlayers.org/dev/examples/geojson-reprojected.html</a><br>
<a class="ecxmoz-txt-link-freetext" href="http://openlayers.org/dev/examples/cartodb-geojson.html" target="_blank">http://openlayers.org/dev/examples/cartodb-geojson.html</a><br>
<br>
They both use a Fixed strategy which is the best one if you want to
load your data once and have it in a static file or known URL.<br>
<br>
You would add your style definition to the vector layer definition
they present in these examples and then you would have a layer with
features to be symbolized.<br>
<br>
Matt Priour<br>
Kestrel Computer Consulting<br>
<br>
<br>
<div class="ecxmoz-cite-prefix">On 12/12/2012 6:21 AM, Gery . wrote:<br>
</div>
<blockquote cite="mid:DUB117-W120D378749F077985D488CAB04F0@phx.gbl">
<div dir="ltr">
<style><!--
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
--></style>
<div dir="ltr"><font style="font-size:10pt" face="Arial" color="#366092" size="2">Hello,<br>
<br>
I have some features in GeoJSON format I want to display, so
I did this:<br>
<br>
[code]<br>
</font><font style="font-size:10pt" face="Arial" color="#366092" size="2"> var vectorLayer = null;<br>
<br>
var vectorStyle =<br>
{<br>
graphicName: 'square',<br>
strokeColor: '#222',<br>
fillColor: '#222'<br>
};<br>
<br>
var styleDefault = OpenLayers.Util.applyDefaults(<br>
vectorStyle,<br>
OpenLayers.Feature.Vector.style['default']<br>
);<br>
<br>
vectorLayer = new OpenLayers.Layer.Vector('search',<br>
{<br>
styleMap: new OpenLayers.StyleMap(<br>
{<br>
'default': styleDefault<br>
}<br>
),<br>
displayInLayerSwitcher: true<br>
}<br>
);<br>
</font><font style="font-size:10pt" face="Arial" color="#366092" size="2">[/code]<br>
<br>
but they don't appear in the map, my question is if this is
enough to get the features displayed or do I need something
else there? if this is enough, I should think that this
problem is about how the features are being read by OL. In
fact, this doesn't work either:<br>
<br>
var ll = new OpenLayers.LonLat(feature.geometry.x,
feature.geometry.y);<br>
mapPanel.map.setCenter(ll);<br>
<br>
I get: <br>
<br>
</font>
<div role="listitem" class="ecxerrorTitle ecxfocusRow ecxsubLogRow "><span class="ecxerrorMessage ">feature is not defined</span></div>
<span class="ecx "></span>
<table class="ecx " cellpadding="0" cellspacing="0">
<tbody class="ecx ">
<tr class="ecx ">
<td class="ecx "><img src="http://gfx2.hotmail.com/mail/w4/pr04/ltr/i_safe.gif" role="checkbox" title="Break On This Error" class="ecxerrorBreak ecxa11yFocus "></td>
<td class="ecx "><a class="ecxerrorSource ecxa11yFocus " target="_blank">
<pre title="ll = new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y);" class="ecxerrorSourceCode ">var ll = new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y);</pre>
</a></td>
</tr>
</tbody>
</table>
<font style="font-size:10pt" face="Arial" color="#366092" size="2"><br>
why should this happen? thanks in advance</font><br id="ecxFontBreak">
<br>
<br>
<font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br>
__________________________________________________________________________________________<br>
Piensa en el medio ambie<font style="" face="Arial">nte -
mantenlo en la pantalla. NO lo imprimas si NO es
necesario.</font></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br>
</font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2">Think green - keep it on the screen. Do NOT
print if it is NOT necessary.</font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><br>
</font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" face="Arial" color="#1F497D" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren
Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span>
<span class="ecxhps">Drucken Sie NICHT</span><span>, wenn</span>
<span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br>
</div>
</div>
<br>
<fieldset class="ecxmimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
Users mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
</blockquote>
<br>
<br>_______________________________________________
Users mailing list
Users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users</div> </div></body>
</html>