This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Online Maps with OpenLayers

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Dateline and style rules questions

Go back to: General discussion

I can't seem to centre my map the way I want and I can't go east. Then I saw the example about wrapping the dateline. But I am not sure how to apply that my layers. Can someone please give me a hint?

And do the style rules seem to be designed for a min/max number value. Does it also work with text? As in if "data text string" = "value a" set some marker attribute to "the desired color".

Thanks

intro vert's picture
intro vert
Thu, 2011-03-17 11:31

and here's another question about my map, http://jsfiddle.net/introvert/2xz4w/4/. If you look at the Auckland region you will see several overlapping circles. If I adjust the range of sizes so this doesn't happen the smallest circles are too small to see. If I was doing this by hand, I would spread out the circles and draw a line to the centre of the respective Playcentre association. Is that the approach here as well?

Nick Doiron's picture
Nick Doiron
Thu, 2011-03-17 23:12

This is the best I could find for now -- replace the two lines that create and add your OpenLayers.Layer.OSM layer with these:

var mapnik = new OpenLayers.Layer.OSM("Mapnik", null, {
displayOutsideMaxExtent: false,
wrapDateLine: true
});
nz_map.addLayer(mapnik);

This allows you to scroll east, past the dateline, but then everything goes blank until the new tiles are loaded. New Zealand and lands east never appear at the same time. I think they're working on this.

intro vert's picture
intro vert
Fri, 2011-03-18 02:41

Thank you Nick. I now can move east. But only one side of the dateline is displayed at a time with pink/empty tiles for the other side.
But what a surprising limitation. It seems it is not possible to show all of NZ, Kiribati, Fiji, Tuvalu, Aleutian Islands, Antartica and Russian Siberia on one map.

Nick Doiron's picture
Nick Doiron
Sun, 2011-03-20 01:11

I didn't fix the int'l date line problem, but blue tiles are better than blank or pink ones: http://p2pu.org/webcraft/node/12927/document/27802

intro vert's picture
intro vert
Wed, 2011-03-23 11:54

Thank you!
Just for fun, I split my data to three layers, http://jsfiddle.net/introvert/2xz4w/10/
It works fine at jsFiddle but on my machine (Firefox) not all layers are clickable at the same time. Only the last layer added that is also selected responds to mouse clicks. Any ideas why that is happening?

Nick Doiron's picture
Nick Doiron
Wed, 2011-03-23 21:27

The SelectControl needs to be listening to events from a layer for it to show you popup windows, and I don't believe it's possible for it to listen to more than one layer at a time.

intro vert's picture
intro vert
Thu, 2011-03-24 09:57

Yes, that makes sense and I guess I was working too late (and I have a cold)