[OpenLayers-Users] OpenLayers with 900913 projection and drupal OpenLayers module

Stephen Woodbridge woodbri at swoodbridge.com
Thu Jan 10 16:44:48 PST 2013


Alex,

I don't use drupal, but if I understand it correctly its job is to 
generate some html and send it to the browser. Once the code is in the 
browser then drupal does not do anything unless you generate an ajax 
request or otherwise go back to the server.

Since OpenLayers is all client side, it is not dependent on drupal other 
than to generate the correct html in the first place.

So you can remove drupal from the equation temporarily, but saving the 
rendered page as and html page that you can edit directly to test out 
how things work.

For example if you make the page look like this:

http://imaptools.com:8080/demo/tiger-tiles.html?zoom=18&lat=40.771347&lon=-73.922842&layers=BT

it should work. Create a static page and edit the javascript and html 
until you have something that works, then you know what you need drupal 
to generate so it will work. You have TOO MANY moving pieces at the 
moment, simplify the problem and get part of it to work, then it will be 
easier to get the other part to work.

-Steve

On 1/10/2013 5:22 PM, Alexander Kocisky wrote:
> Hi Stephen,
>
> ok, i will check on the projCode, it might be only the structure for
> holding that param. I've added "sphericalMercator: true" to the map
> options and to the layer options but apparently nothing changed. I've
> tried to pass it as a true value or as a "true" string. Here are the two
> objects:
>
> The map: openlayers-map-cf0776af options are: {
>      "projection": {
>          "projCode": "EPSG:900913"
>      },
>      "displayProjection": {
>          "projCode": "EPSG:4326"
>      },
>      "maxExtent": {
>          "left": -20037508.34,
>          "bottom": -20037508.34,
>          "right": 20037508.34,
>          "top": 20037508.34
>      },
>      "units": "m",
>      "sphericalMercator": true,
>      "maxResolution": "auto",
>      "controls": [],
>      "theme": "/sites/all/modules/openlayers/themes/default_dark/style.css"
> }
>
> The layer is {
>      "my_wms_layer": {
>          "base_url":
> "http://gis.site.org:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=MyMap:my_layer",
>          "params": {
>              "isBaseLayer": 0,
>              "buffer": 2,
>              "ratio": 1.5,
>              "singleTile": 0,
>              "sphericalMercator": 1,
>              "resolutions": [
>                  156543.0339,
>                  78271.51695,
>                  39135.758475,
>                  19567.8792375,
>                  9783.93961875,
>                  4891.969809375,
>                  2445.9849046875,
>                  1222.9924523438,
>                  611.49622617188,
>                  305.74811308594,
>                  152.87405654297,
>                  76.437028271484,
>                  38.218514135742,
>                  19.109257067871,
>                  9.5546285339355,
>                  4.7773142669678,
>                  2.3886571334839,
>                  1.1943285667419,
>                  0.59716428337097
>              ],
>              "projection": {
>                  "projCode": "EPSG:900913"
>              },
>              "maxextent": [
>                  -20037508,
>                  -20037508,
>                  20037508,
>                  20037508
>              ],
>              "drupalID": "my_wms_layer",
>              "units": "m",
>              "maxExtent": {
>                  "left": -20037508.34,
>                  "bottom": -20037508.34,
>                  "right": 20037508.34,
>                  "top": 20037508.34
>              }
> ...
>
> I think i should look at why that bound box parameter is incorrect,
> please let me know if you have any suggestions.
> Thank you again so much!
>
> Alex



More information about the Users mailing list