[OpenLayers-Users] Drawing on the fly route
Matthew Pulis
mpulis at gmail.com
Fri Nov 23 12:31:01 EST 2007
Hi,
Just would like to say that finally with the help of crschmidt and pgiraud
from #OpenLayers , I managed to get the routing working.
I would like to say that the tutorial on pgRouting has some old things that
I suggest should be changed to reflect the new OpenLayers.js
function displayRoute(response) {
if (response && response.responseXML) {
// erase the previous results result.removeFeatures(result.features);
// parse the features var edges =
response.responseXML.getElementsByTagName('edge');
var features = []; for (var i = 0; i < edges.length; i++) {
var wkt = edges[i].getElementsByTagName('wkt')[0].textContent; var g =
parser.read(wkt); features.push(g);
} result.addFeatures(features);
}
}
In the function on the wiki, there is features.push(new
OpenLayers.Feature.Vector(g)); which now should just be changed with
features.push(g); since g is already a Feature.Vector array so no need to
mention it again.
Thanks alot for your support, and hope this thread helps others with my
problem :)
Cheers
On 11/22/07, Matthew Pulis <mpulis at gmail.com> wrote:
>
> Thanks Roald for your Interest
>
> I tried to make the "edge" instead of 'edge' and also tried "wkt" instead
> of 'wkt' but to no avail :(
>
> I also rechecked the characterset : doesn't appear to me I should rechange
> the charset .. u have anymore info why I should please?
>
> Thanks again
>
> On 11/22/07, Roald de Wit <rdewit at users.sourceforge.net> wrote:
> >
> >
> > On Wed, 2007-11-21 at 11:47 +0100, Matthew Pulis wrote:
> > > Hi guys :)
> > >
> > <snip>
> > > I get this error :
> > >
> > > String contains an invalid character" code: "5
> > > http://yancho.no-ip.org/~yancho/OpenLayers.js
> > > Line 554
> > >
> >
> > Not sure: could it be your XML is in another character set (in
> > ISO-8859-1 for example) than it says it is (UTF-8)?
> > I see you use a single quote for your edge id. What happens when you
> > make that a double quote?
> >
> > Or maybe you tried to do something like this:
> > http://www.nabble.com/DrawFeature:-box-supported--t4627077.html
> >
> > If so, you tried to feed the data in a wrong format to a method, or
> > maybe the right format to the wrong method... ;-)
> >
> > Kind regards,
> >
> > Roald
> > --
> > Roald de Wit
> > Software Engineer
> > roald.dewit at lisasoft.com
> >
> > Commercial Support for Open Source GIS Software
> > http://lisasoft.com/LISAsoft/SupportedProducts/
> >
> >
>
>
> --
> Matthew Pulis
> URL : http://www.solutions-lab.net
> MSN : pulis_matthew[@]hotmail.com
> ICQ : 145951110
> Skype : solutions-lab.net
>
--
Matthew Pulis
URL : http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : solutions-lab.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071123/62ffff3e/attachment.html
More information about the Users
mailing list