cgxp.plugins.MyPosition

ptype
cgxp_myposition
class cgxp.plugins.MyPosition(config)

Provides a “My Position” button that tries to recenter on the user’s current position.

Example Use

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

new gxp.Viewer({
    ...
    tools: [{
        ptype: "cgxp_myposition",
        actionTarget: "center.tbar"
    }]
    ...
});

Config Options

Configuration properties.

drawAccuracy

Boolean

If true, a circle is displayed around the user’s position, showing the accuracy of the geolocation. Default is false.

recenteringZoom

Number

Zoomlevel to use when recentering to the user’s location. Default is 11.

styleAccuracy

Object

Feature style hash to apply to the accuracy circle, default is {fillColor: “#f70082”, strokeColor: “#f70082”, fillOpacity: 0.4}.

stylePoint

Object

Feature style hash to apply to the position marker, default is {pointRadius: 4}.

Table Of Contents

Previous topic

cgxp.plugins.MouseCoordinates

Next topic

cgxp.plugins.OSMSource

This Page

Fork me on GitHub