In this first example, we'll use the code similar to what we just saw above—making use of all three classes to build our vector layer, which will request data from a URL.
There are two caveats to this example. The first is that it assumes you have a file called
ex5_data.json in the same directory as your map file. You can find it in this book's source code files at http://vasir.net/openlayers_book/files/.
Secondly, unless you are running this on a server, it won't work. It will need a proxy host, which we'll cover right after this example. If you do not have access to a server, you can view the example in action at the URL above.