Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

3 Answers

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

http://dakcarto.github.com/qgis-web-client/

share|improve this answer
1  
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
1  
@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
add comment

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="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>

Codes:

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}
);


geoExtMap.map.addLayers([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
add comment

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
add comment

Your Answer

 
discard

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.