followup questions about using Lunaserv with OpenLayers3

39 views
Skip to first unread message

Tamar Cohen

unread,
Oct 27, 2015, 8:13:10 AM10/27/15
to Lunaserv
Apologies, the last question posted when I pasted my example.

Any rate, I see that your example page is built in OpenLayers 2; I am working with OpenLayers3 and wondering if anyone has success using Lunaserv as the WMS server for OL3?
Specifically with a non-standard projection.

Thanks much for any input.
Tamar

Nick Estes

unread,
Oct 27, 2015, 8:22:51 AM10/27/15
to Tamar Cohen, Lunaserv
Tamar,

I've only played with OpenLayers 3 a little bit, but I had good luck
defining the IAU2000 projection using OL3's Proj4JS integration.
Basically you define it using the proj4 string and then you can use it
like any other projection.

You can define the projection using something like this:

proj4.defs('IAU2000:30120', '+proj=stere +lat_0=-90 +lon_0=0 +k=1 +x_0=0
+y_0=0 +a=1737400 +b=1737400 +units=m +no_defs');

Then the projection should be available to OL3. You can look up the
proj4 strings for IAU2000 projections at
http://spatialreference.org/ref/iau2000/

--Nick
> --
> You received this message because you are subscribed to the Google
> Groups "Lunaserv" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lunaserv+u...@googlegroups.com.
> To post to this group, send email to luna...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lunaserv.

Tamar Cohen

unread,
Oct 27, 2015, 6:50:06 PM10/27/15
to Lunaserv, tama...@gmail.com
Thanks Nick -- the projection was no problem.  The issue I'm having is how to actually successfully retrieve data from the asu server.
Turns out I was using the wrong URL; this seems to work:

new ol.layer.Tile( {

        name: "asu_basemap",

extent: [-992800, -992800, 992800, 992800],

    source: new ol.source.TileWMS({url:'http://webmap.lroc.asu.edu/', //http://wms.lroc.asu.edu/lroc',

    params: {'projection': 'SP_STEREO'

//     'c_lon': -14.192, 

//     'c_lat':-86.33,

    'c_lon': 0,

    'c_lat': 0,

    'x':0, 

    'y':0, 

    'resolution':3474.8,

    'srs':'IAU2000:30120',

    'version': '1.0.0',

    'LAYERS':'luna_wac_global'},


thanks!

Tamar

Reply all
Reply to author
Forward
0 new messages