[GeoNode-users] google api policy

Giovani Fronza giovanifronza at gmail.com
Fri Aug 5 12:41:49 PDT 2016


I did it today, motivated by these toppics in the list.
I've put these code on my settings.py:

# A Google Maps API key is needed for the 3D Google Earth view of maps
# See http://code.google.com/apis/maps/signup.html
GOOGLE_API_KEY = '<your key rehe>'

try:
    GOOGLE_LAYER_SAT = {
        "source": {
            "ptype": "gxp_googlesource",
            "apiKey": GOOGLE_API_KEY
        },
        "name": "SATELLITE",
        "fixed": True,
        "visibility": False,
        "group": "background"
    }
    MAP_BASELAYERS.append(GOOGLE_LAYER_SAT)
except GoogleAPIError:
    print "Not enabling Google  Maps base layer as a GOOGLE_API_KEY is not
defined in settings.py file."



You could even change name "SATELLITE" by ROADMAP, HYBRID, or TERRAIN.
After changes, restart your apache to make efect.




2016-08-05 15:14 GMT-03:00 Charles Cossé <ccosse at gmail.com>:

> Shouldn't it go in site_base.html?  as a Javascript include?
> -Charles
>
> On Aug 5, 2016 5:47 AM, "István Szőcs" <borohoro at gmail.com> wrote:
>
>> Hello !
>>
>> Thank you for clearing that out. I have put the key in the file.
>> Do you know if there's a time frame until a new key becomes active ?
>> Because it's still not loading the google layers.
>> And I know that this is a geonode forum, please forgive me, but perhaps
>> somebody knows the same thing for an Opengeo Suite install (on Windows) ?
>> I couldn't find the file where to insert the key, of course
>> local_settings.py is not present over there.
>> So what would be the equivalent file in which to insert the key on an
>> Opengeo Suite installation ?
>>
>>
>> kind regards,
>>           István
>>
>>
>> On Thu, Aug 4, 2016 at 12:48 PM, Amedeo Fadini <amefad at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> Il 04/ago/2016 10:08 AM, "István Szőcs" <borohoro at gmail.com> ha scritto:
>>> >
>>> > Hello !
>>> >
>>> >  Can somebody please tell me where to insert this key, in which file
>>> on the server ?
>>>
>>> Quite simple: in /etc/geonode/local_settings.py
>>>
>>> see also
>>>
>>> http://docs.geonode.org/en/master/tutorials/advanced/geonode
>>> _production/production.html
>>>
>>> amedeo
>>>
>>
>>
>> _______________________________________________
>> geonode-users mailing list
>> geonode-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/geonode-users
>>
>>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20160805/81678e94/attachment.html>


More information about the geonode-users mailing list