[OpenLayers-Users] map doesn't align with Google maps when
accessed via a proxy
Andreas Hocevar
ahocevar at opengeo.org
Wed Dec 7 11:12:05 EST 2011
Hi,
then what makes you think OpenLayers is to blame?
Note that you don't need to go through a proxy to retrieve map images.
Only if you retrieve content you need to process with JavaScript. If I
were you, I'd look at the http server log of the machine that
MapServer runs on. My guts feeling says that your proxy doesn't handle
all characters correctly (e.g. the colon in EPSG: identifiers).
Andreas.
On Wed, Dec 7, 2011 at 4:42 PM, Puneet Kishor <punk.kish at gmail.com> wrote:
> Hi Andreas,
>
>
> On Dec 7, 2011, at 3:32 AM, Andreas Hocevar wrote:
>
>> Don't forget to configure your map with the appropriate options for
>> Web Mercator layers:
>>
>> {
>> projection: "EPSG:3857",
>> units: "m",
>> maxResolution: 156543.0339,
>> maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34]
>> }
>>
>>
>
>
> Yes, of course. My map is configured with the above options, and as I said in my original post, it works just fine when retrieved directly as a WMS from OpenLayers. However, as I also said, I need to experiment with a request via a proxy. When I do that, I end up getting either a complete map per tile request, or, if I use singleTile:true, I do get a single map correctly but the map is shifted completely.
>
> I am passing to the proxy all the parameters that OpenLayers is sending, so MapServer is receiving everything that it would have received directly.
>
>
>> On Tue, Dec 6, 2011 at 11:46 PM, Puneet Kishor <punk.kish at gmail.com> wrote:
>>> I have a simple WMS (served by MapServer) overlaid on a Google Map baselayer defined like so
>>>
>>> var layer = new OpenLayers.Layer.WMS(
>>> "Layer name",
>>> "http://path/to/cgi-bin/app",
>>> {layers: "layer", transparent: true},
>>> {isBaseLayer: false, opacity: 0.6}
>>> );
>>>
>>> The above works very well but, now I have to get the above layer via a proxy. As is, I end up getting the complete map repeated in every tile. So, I changed the layer definition to the following
>>>
>>> var layer = new OpenLayers.Layer.WMS(
>>> "Layer name",
>>> "http://path/to/proxy/app",
>>> {layers: "layer", transparent: true},
>>> {isBaseLayer: false, opacity: 0.6, singleTile: true}
>>> );
>>>
>>> Now I get a single complete map, however, it doesn't align with the Google Map baselayer. I tried adding `sphericalMercator: true` to the layer definition but no joy.
>>>
>>> Suggestions?
>>>
>>>
>>> --
>>> Puneet Kishor_______________________________________________
>>> Users mailing list
>>> Users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>>
>> --
>> Andreas Hocevar
>> OpenGeo - http://opengeo.org/
>> Expert service straight from the developers.
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list