Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to add a google maps layer in a qgis web client project?

I made a qgis project using a google maps layer from OpenLayers Plugin. In my desktop project, this layer works fine. But when I load the same project in the qgis-web-client all my layers are loaded, except the google maps layer.

share|improve this question

There is a fork of the qgis web client that should do the trick. However I haven't tested it

share|improve this answer
Unfortunately DCARTO didn't make any changes to the code much less add base layer functionality. The code is basically a snapshot of the main QGIS Web Client at an earlier date. Would be awesome if there really was a straightforward way to pull in base layers to QGIS Web Client. – Rayner Sep 3 '12 at 16:02
@Raynor, unfortunately, you are correct. It appears none of my work is reflected in the noted repository. Must have been an error somewhere along the way when I was just moving to git and syncing repos. I will dig up my QGIS web client project and push up to the repo ASAP. – dakcarto Sep 3 '12 at 18:00
@dakcarto, any chance of getting your qgis-web-client repository updated? Sure would be neat to play around with overlays and base layers in QGIS Web Client. – Rayner Sep 14 '12 at 19:55

i havent tried this but i think this would be work.

first of all add all openlayers file in site / libs / openlayers as to getting dependencies. then make a js file with name qgis-modifications and add this to your main file... write the following code in your qgis-modifications.js. this should work...

and consider this for adding google maps to your project. more info here...

<script src=""></script>


var gphy = new OpenLayers.Layer.Google(
    "Google Physical",
    {type: G_PHYSICAL_MAP}
var gmap = new OpenLayers.Layer.Google(
    "Google Streets", // the default
    {numZoomLevels: 20}
var ghyb = new OpenLayers.Layer.Google(
    "Google Hybrid",
    {type: G_HYBRID_MAP, numZoomLevels: 20}
var gsat = new OpenLayers.Layer.Google(
    "Google Satellite",
    {type: G_SATELLITE_MAP, numZoomLevels: 22}
);[gphy, gmap, ghyb, gsat]);

i hope it helps you...

share|improve this answer
thanks for your answer.... But, unhappily, it doesn't work for me... My Qgis project with a layer of google maps works fine at Qgis Client, but still dont show the google map in qgis-web-client, even with this new qgis-modifications.js ... :( Thanks Any way – Kadu Mpires Jul 11 '12 at 20:09

This is another comment. It appears I'm unable to add comments to other people's answers due to a lack of points. Thanks for moving my previous answer to a comment where it belongs. Wish this didn't have to be so difficult, but I understand the reasoning.

Just wanted to say thanks to DAKCARTO and sorry for misspelling your name. Looking forward to working with your base layers solution once you find your QGIS web client project and push up to the repo.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.