Hi,

sounds like a scope issue. Is vectorLayer known to your test()
function? Use Firebug or your favorite debugger to find out.

Regards,
Andreas.

On Fri, Jul 17, 2009 at 2:14 PM, maelstrom666<[email protected]> wrote:
>
> Hi I am having some issues with geometry in OL.
> When I click a button, it activates a function which should add a point to
> the map.
> Here is the code for that function:
> <script language="javascript" type="text/javascript">
> function test()
> {
>        var point2 = new OpenLayers.Geometry.Point(-101.04, 45.68);
>        var pointFeature2 = new 
> OpenLayers.Feature.Vector(point2,null,style_blue);
>        vectorLayer.addFeatures([pointFeature2])
> }
> </script>
>
> in the function init, i have another point which shows up without any issues
> here is an excerpt of tht code:
>
> var point = new OpenLayers.Geometry.Point(-111.04, 45.68);
> var pointFeature = new OpenLayers.Feature.Vector(point,null,style_blue);
> vectorLayer.addFeatures([pointFeature]);
> map.addLayer(vectorLayer);
>
> If you need more code or anything please tell me.
> Thanks,
> Rohan
>
> --
> View this message in context: 
> http://n2.nabble.com/Problem-with-geometry-in-OL-tp3275045p3275045.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to