Thank you very much,
This is my Google layer serializer for PrintProvider:
"Google": function(layer) {
var gMapType = layer.type;
var maptype = "roadmap"; //default map type
switch (gMapType) {
case google.maps.MapTypeId.ROADMAP:
maptype = "roadmap";
break;
case google.maps.MapTypeId.SATELLITE:
maptype = "satellite";
break;
case google.maps.MapTypeId.HYBRID:
maptype = "hybrid";
break;
case google.maps.MapTypeId.TERRAIN:
maptype = "terrain";
break;
}
return {
baseURL: 'http://maps.google.com/maps/api/staticmap',
type : 'TiledGoogle',
maxExtent:
[-20037508.3392,-20037508.3392,20037508.3392,20037508.3392],
tileSize: [256,256],
resolutions:
[156543.0339,78271.51695,39135.758475,19567.8792375,9783.93961875,4891.969809375,2445.9849046875,1222.99245234375,611.496226171875,305.7481130859375,152.87405654296876,76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833709717],
extension : 'png',
format : 'png',
sensor: 'false',
maptype: maptype
}
}
On Fri, Apr 8, 2011 at 4:59 AM, Matt Priour <[email protected]>wrote:
> shh!! It's a secret ; )
> just kidding.
> I discovered it a couple of weeks ago when searching the source code of the
> mapfish print module. The non-premium Google Layers uses the Google Static
> Maps API and thus would be restricted by that license/TOS which, I think, is
> a bit different than the normal Google Maps API TOS
>
> However, GeoExt print provider doesn't have a GoogleTiles serializer, so
> you would need to implement it or submit a patch to be able to use that.
>
> Matt Priour
>
> *From:* Alexandre Dube <[email protected]>
> *Sent:* Thursday, April 07, 2011 2:10 PM
> *To:* Cédric MOULLET <[email protected]>
> *Cc:* [email protected]
> *Subject:* Re: [Dev] Print map error with OpenStreetMap
>
> Whoa, nice ! Is there any doc about this somewhere ? What about licenses
> ?
>
> Regards,
>
> Alexandre
>
>
> On 11-04-07 03:06 PM, Cédric MOULLET wrote:
>
> Small update: Google layers is supported by MapFish print (see
> http://trac.mapfish.org/trac/mapfish/browser/print/trunk/src/main/java/org/mapfish/print/map/readers/google
> ).
> Cédric
>
> On Thu, Apr 7, 2011 at 8:46 PM, Alexandre Dube <[email protected]> wrote:
>
>> Hi,
>>
>> Google isn't supported by the Mapfish print module.
>>
>> For the rest, this is beyond my knowledge. You should start a new
>> thread on the MapFish-Users mailing list and post your issue there.
>>
>> Regards,
>>
>> Alexandre
>>
>>
>> On 11-04-07 02:34 PM, Toan Nguyen wrote:
>>
>> Hi,
>>
>> Thanks Alexandre, I have just edited PrintProvider to add the baselayer
>> first. Because I also want to change baseURL for my layers, I use
>> geowebcache for GeoServer, so I must edit baseURL of WMS layer to geoserver
>> wms serivce.
>>
>> I also try to print Google Layer. But I have some problem, I can't
>> understand.
>>
>> This is my print page (image: printpage.png);
>>
>> if I print with geodetic = false, then result seem to correct, but
>> actually the width and height of Google Layer not match well. And the
>> polygon vector not match with layer. (aic4-printmap-1.pdf)
>>
>> If I print with geodetic = true, it match all, but size of image map is
>> wrong, I larger than preview page. (aic4-printmap-2.pdf)
>>
>> Do you know that problem?
>>
>>
>> On Thu, Apr 7, 2011 at 9:20 PM, Alexandre Dube <[email protected]>wrote:
>>
>>> Hi,
>>>
>>> If you're using GeoExt 1.0, that could be related to this bug [1],
>>> which was fixed in trunk so you could try with it and see if that solves
>>> your problem.
>>>
>>> If you don't want or can't change your version, you could try to add
>>> your OSM layer before the others since in 1.0 the layers are added in the
>>> parameters in their "added to the map" order.
>>>
>>> Regards,
>>>
>>> [1] http://trac.geoext.org/ticket/398
>>>
>>>
>>>
>>> On 11-04-07 09:01 AM, Toan Nguyen wrote:
>>>
>>> Thank you, Alexandre.
>>>
>>> I don't know about it, I have added tile.openstreetmap.org to host list,
>>> and it work well.
>>> But I have a new problem. I use OpenStreetMap as base layer, and other is
>>> overlay layer. When I print map, the OpenStreetMap alway on top, therefore I
>>> can't see other layer. I think OpenStreetMap is must at the end. If I don't
>>> use OpenStreetMap, the layer order is OK.
>>>
>>> Is it an error of PrintModule? Can we fix it?
>>>
>>> On Thu, Apr 7, 2011 at 7:10 PM, Alexandre Dube <[email protected]>wrote:
>>>
>>>> Hi,
>>>>
>>>> The error comes from mapfish print module. Do you have "
>>>> tile.openstreetmap.org" in your host list of your config.yaml file ?
>>>>
>>>> Alexandre
>>>>
>>>>
>>>>
>>>>
>>>> On 11-04-07 02:30 AM, Toan Nguyen wrote:
>>>>
>>>> Hi,
>>>>
>>>> I use PrintProvider to print map with OpenStreetMap as base layer. And I
>>>> get error:
>>>>
>>>> Error while generating PDF:
>>>> DocumentException: org.mapfish.print.InvalidJsonValueException:
>>>> spec.layers[2].baseURL has an invalid value:
>>>> http://tile.openstreetmap.org/ (spec.layers[2].baseURL has an invalid
>>>> value: http://tile.openstreetmap.org/)
>>>> .......................................................
>>>>
>>>> This is my data:
>>>>
>>>> {"units":"m","srs":"EPSG:900913","layout":"A4
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> portrait","dpi":75,"mapTitle":"All
>>>> In Carto
>>>>
>>>>
>>>>
>>>> 4.0","layers":[{"baseURL":"http://localhost:8080/geoserver/wms
>>>> ","opacity":1,"singleTile":false,"type":"WMS","layers":["durbuy:pa_83012"],"format":"image/png","styles":[""],"customParams":{"TRANSPARENT":true,"FORMAT_OPTIONS":"dpi:300"}},{"baseURL":"
>>>> http://localhost:8080/geoserver/wms
>>>> ","opacity":1,"singleTile":false,"type":"WMS","layers":["durbuy:ba_83012"],"format":"image/png","styles":[""],"customParams":{"TRANSPARENT":true,"FORMAT_OPTIONS":"dpi:300"}},{"baseURL":"
>>>> http://tile.openstreetmap.org/
>>>> ","opacity":1,"singleTile":false,"type":"OSM","maxExtent":[-20037508.3392,-20037508.3392,20037508.3392,20037508.3392],"tileSize":[256,256],"extension":"png","resolutions":[156543.0339,78271.51695,39135.758475,19567.8792375,9783.93961875,4891.969809375,2445.9849046875,1222.99245234375,611.496226171875,305.7481130859375,152.87405654296876,76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833709717]}],"pages":[{"center":[610975.35710802,6506458.6443756],"scale":50000,"rotation":0,"mapTitle":"All
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> In Carto
>>>>
>>>>
>>>>
>>>>
>>>> 4.0","comment":""}],"legends":[{"name":"Batiments","classes":[{"name":"","icons":["
>>>> http://localhost:8080/geoserver/wms?TRANSPARENT=true&FORMAT_OPTIONS=dpi%3A300&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=durbuy%3Aba_83012&SCALE=68247.38352453541&FORMAT=image%2Fpng&LEGEND_OPTIONS=forceLabels%3Aon
>>>> "]}]},{"name":"Parcelles","classes":[{"name":"","icons":["
>>>> http://localhost:8080/geoserver/wms?TRANSPARENT=true&FORMAT_OPTIONS=dpi%3A300&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=durbuy%3Apa_83012&SCALE=68247.38352453541&FORMAT=image%2Fpng&LEGEND_OPTIONS=forceLabels%3Aon
>>>> "]}]}]}
>>>>
>>>> This error from PrintProvider or mapfish print module?
>>>> Thanks.
>>>>
>>>> --
>>>> Nguyễn Đình Toán
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing
>>>> [email protected]http://www.geoext.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>>
>>>> --
>>>> Alexandre Dubé
>>>> Mapgearswww.mapgears.com
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://www.geoext.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Nguyễn Đình Toán
>>>
>>>
>>>
>>> --
>>> Alexandre Dubé
>>> Mapgearswww.mapgears.com
>>>
>>>
>>
>>
>> --
>> Nguyễn Đình Toán
>>
>>
>>
>> --
>> Alexandre Dubé
>> Mapgearswww.mapgears.com
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://www.geoext.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Political blog: http://cedricmoullet.blogspot.com/
> Welcome to my world: http://www.cedricmoullet.com/
> My Linked In profile: http://www.linkedin.com/in/cedricmoullet
> Twitter: http://twitter.com/cedricmoullet
> Home sweet home:
> http://map.geo.admin.ch/?crosshair=bowl&zoom=11&X=185241.24219&Y=561288.90625&bgOpacity=0&selectedNode=node_ch.swisstopo.fixpunkte-lage1
>
>
>
> --
> Alexandre Dubé
> Mapgearswww.mapgears.com
>
> ------------------------------
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/dev
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/dev
>
>
--
Nguyễn Đình Toán
_______________________________________________
Dev mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/dev