[OpenLayers-Users] Question on changing Popups on Textlayer
Yves Moisan
yves.moisan at boreal-is.com
Mon Nov 17 14:23:50 EST 2008
Le lundi 17 novembre 2008 à 12:51 -0500, Christopher Schmidt a écrit :
> On Mon, Nov 17, 2008 at 11:44:50AM -0500, Yves Moisan wrote:
> >
> > > >
> > > > projects = new OpenLayers.Layer.Text( "Projects",
> > > > {location:"project-locations.txt", projection: new
> > > > OpenLayers.Projection("EPSG:4326")} );
> > > >
> > > > projects = new OpenLayers.Layer.GML("Projects",
> > > > "project-locations.txt",
> > > > {format: OpenLayers.Format.Text, projection: new
> > > > OpenLayers.Projection("EPSG:4326") });
> > >
> > > How does it not? can you provide an example? It should.
> >
> > The only thing I can think of is that my textfile is not read the same
> > way by both forms. The beginning of it is :
> >
> > lat lon title description icon iconSize iconOffset
> > 48.9 9.6075669 Bleu 24x24 Description one<br>Second line.<br>(click
> > again to close) images/Ol_icon_blue_example.png 24,24 0,-24
> > 48.9899851 9.5382032 Rouge 8x8 Description two.
> > images/Ol_icon_red_example.png 8,8 -8,-8
> >
> > I made sure I have tabs everywhere. It seems the GML layer is stricter
> > than the .Text layer. In the latter case, if I did not put iconSize and
> > iconOffset, symbols would draw whereas with a GML layer they don't.
> > Another issue I have is that the GML layer gives me an "Undefined" for
> > title. I tried quoting the title, but to no avail. Have the
> > requirements for the textfile changed ?
>
> I'm having a lot of trouble visualizing what you're talking about. I
> could do much better with example code or an example URL to look at
> (latter preferred).
I can't provide you with a url at this point and the code is up there :
a layer and it's associated textfile.
>
> The Layer.Text and the Layer.GML both use the exact same parser for the
> Text File -- the only difference is in how they use the returned
> features.
Then why form 1 works and form 2 doesn't ? I use the exact same
textfile and in one case I get a title and features on my map if I do
not specify icon related attributes in my text file and in the other
case I get "Undefined" for a title and icon* attributes are not
optional. Whence my question.
>
> It's possible that more needs to be dne here, and with code examples of
> what should work, but doesn't, we can pursue them.
>
> I'll also note, again, that I highly recommend *not* using the
> OpenLayers-specific, non-extensible Format.Text, even if it makes some
> things slightly easier, because it's simply locking your data up in
> another proprietary format.
I'm using the Format.Text layer for a website that is deployed on Yahoo
(no spatial DB available on that machine, just MySQL). I thought it was
pretty neat to use a textfile and get a popup, but of course I got
caught in trying to alter OpenLayers.Layer.Text's popup (no framedCloud
there) so now comes a way to get a framedCloud popup with a textfile so
I try it. The other thing is I could use an OGR virtual file to map a
MySQL table, but I'm not sure I can deploy OGR on Yahoo. It's so much
simpler with a textfile.
TIA,
Yves Moisan
>
> Regards,
More information about the Users
mailing list