The Proximitii Crime Widget displays crime risk patterns around a selected location with configurable title, map, pin, and brand styling.
Installation
Add the following embed code to your page or template. Replace the widget key and coordinates with your own values.
<div id="prox-crime"></div>
<script src="https://widget.proximitii.com/v1/core/proximitii-widget.js?v=35"></script>
<script>
ProximitiiWidgets.crime({
container: 'prox-crime',
widgetKey: "PUT_YOUR_WIDGET_KEY_HERE",
lat: 40.778832684988224,
lon: -73.98103168840414
});
</script>
Always provide a valid widgetKey, lat, and lon. All other settings are optional and fall back to the defaults listed below.
Customization
The following Crime Widget customization options are available.
| Name | Description | Default Value | Accepted Values | Variable / Function |
|---|---|---|---|---|
| Container | The ID of the div where the widget renders. | N/A | Any valid element ID | container |
| Widget Key | Your public widget key. | N/A | Valid Proximitii widget key | widgetKey |
| Latitude | Sets the latitude of the center location. | N/A | Decimal between -90 and 90 | lat |
| Longitude | Sets the longitude of the center location. | N/A | Decimal between -180 and 180 | lon |
| Show Border | Shows or hides the widget border. | true | true/false | showBorder |
| Title | Sets the widget title. | Crime Risk Map | Any valid text | title |
| Title Font Size | Sets the title font size. | 30px | CSS size | titleFontSize |
| Description | Sets the text shown below the title. | Explore nearby crime risk patterns from the selected location. | Any valid text | description |
| Primary Color | Sets the primary brand color. | #607eb8 | Hex color | primaryColor |
| Secondary Color | Sets the secondary panel/background color. | #f8fafc | Hex color | secondaryColor |
| Font Family | Sets the widget font family. | Poppins, sans-serif | Any valid CSS font-family | fontFamily |
| Box Style | Controls the widget container styling. | shadow | shadow or flat | boxStyle |
| Zoom Level | Sets the starting map zoom. | 13 | Number from 1 to 20 | zoomLevel |
| Height | Sets the widget height. | 550 | Number from 550 to 1000 | height |
| Map Style | Sets the Proximitii map style. | light | light, bright, modern, baseline | mapStyle |
| Show Pin | Shows or hides the location pin. | true | true/false | showPin |
| Show Crime Intensity Scale | Shows or hides the low-to-high crime intensity legend. | true | true/false | showCrimeIntensityScale |
| Disable Gesture Handling | Disables scroll-wheel and gesture handling on the map. | false | true/false | disableGestureHandling |