As the title suggests, my Openlayers map is not displaying clustered points properly and I'm not sure why. My code is pretty simple and straight forward, here it is:
.map { height: 100%; width: 100%; }AIS MapCluster map of ships broadcasting AIS data
I'm basing this heavily off of the examples here: https:// openlayersbook.github.io/ch05-using-vector-layers/example-02.html and here: http:// openlayers.org/en/v3.2.0/examples/cluster.html. The problem I'm having is that the cluster shows up as one point centered at (0,0) like this. Upon zooming in, the cluster expands, as it should. What's weird though(besides it not mapping it right in the first place) is that when you zoom in the points are projected like this. The points are projected to the same locations they should be as if that one single tile is being treated like the whole world. The real locations of the points looks like this: http:// imgur.com/TLARMra. See how the x/y locations of the ships when overlayed on the whole world are the same as the x/y locations when overlayed on that one tile? There's a few less points on the one with boat icons but you can see the clusters around China, France/Germany, and the Eastern US coast all translate to the incorrect projection, along with all the others that are on both maps(The cluster data has a few more points than the non cluster data added for testing specific cases). So I'm almost positive that this is an issue with projection EPSG, etc. but I think I've tried every EPSG code in all different combinations(like including the projection in the layer itself caused the layer to not appear) to no avail. Firebug gives me no errors and it says ol.js is loading fine along with the ol.css. So basically I don't know what is causing this and I don't know how to fix it. Any help with that would be huge as I've been messing with this for a day or so with no success, thanks!
P.S. I apologize for the broken links with spaces, I don't have enough reputation to post more than two links or any pictures.
EDIT I would also like to mention that I'm using OL3 and specifically 3.2
أكثر...
.map { height: 100%; width: 100%; }AIS MapCluster map of ships broadcasting AIS data
I'm basing this heavily off of the examples here: https:// openlayersbook.github.io/ch05-using-vector-layers/example-02.html and here: http:// openlayers.org/en/v3.2.0/examples/cluster.html. The problem I'm having is that the cluster shows up as one point centered at (0,0) like this. Upon zooming in, the cluster expands, as it should. What's weird though(besides it not mapping it right in the first place) is that when you zoom in the points are projected like this. The points are projected to the same locations they should be as if that one single tile is being treated like the whole world. The real locations of the points looks like this: http:// imgur.com/TLARMra. See how the x/y locations of the ships when overlayed on the whole world are the same as the x/y locations when overlayed on that one tile? There's a few less points on the one with boat icons but you can see the clusters around China, France/Germany, and the Eastern US coast all translate to the incorrect projection, along with all the others that are on both maps(The cluster data has a few more points than the non cluster data added for testing specific cases). So I'm almost positive that this is an issue with projection EPSG, etc. but I think I've tried every EPSG code in all different combinations(like including the projection in the layer itself caused the layer to not appear) to no avail. Firebug gives me no errors and it says ol.js is loading fine along with the ol.css. So basically I don't know what is causing this and I don't know how to fix it. Any help with that would be huge as I've been messing with this for a day or so with no success, thanks!
P.S. I apologize for the broken links with spaces, I don't have enough reputation to post more than two links or any pictures.
EDIT I would also like to mention that I'm using OL3 and specifically 3.2
أكثر...