cgxp.plugins.StreetView

ptype
cgxp_streetview
class cgxp.plugins.StreetView(config)

Provides two actions for streetviewing in and out.

Example Use

Sample code showing how to add a StreetView plugin to a gxp.Viewer:

new gxp.Viewer({
    ...
    tools: [{
        ptype: 'cgxp_streetview',
        actionTarget: 'center.tbar',
        outputTarget: 'center',
        toggleGroup: 'maptools',
        baseURL: "${request.static_url('<project>:static/lib/cgxp/geoext.ux/ux/StreetViewPanel/')}"
    }]
    ...
});

To use this plugin we need to create an API key,go to The Google API console:

  • Sign in
  • In “Services” ckeck “Google Maps API v3” and “Street View Image API”.
  • In “API access” click on “Create new Browser key...”.
  • Fill the HTTP referers
  • Click on “Create”
  • Get the “API key”
  • Add this in the index.html file with the right <API key>:
<script type="text/javascript" src='http://maps.google.com/maps?file=api&amp;key=<API key>'></script>

In the jsbuild/app.cfg, add in root:

<project>/static/lib/cgxp/geoext.ux/ux/StreetViewPanel

and in include:

CGXP/plugins/StreetView.js

Config Options

Configuration properties.

actionConfig

Object Config object for the action created by this plugin.

activateToggleGroup

String The name of the activate toggle group this tool is in. Default is “clickgroup”.

baseURL

The UX base URL.

toggleGroup

The group theses toggle buttons are members of.

Table Of Contents

Previous topic

cgxp.plugins.ScaleChooser

Next topic

cgxp.plugins.ThemeFinder

This Page

Fork me on GitHub