This widget shows information related to specific neighbourhoods, boroughs, cities, and other geographies. This information includes Location Scores, heatmaps, text descriptions, and so forth, and is divided into three sections: transportation, services, and character.
A typical implementation of Local Profiles has a separate web page for each neighbourhood. Each of these neighbourhood pages will display Local Profiles for that specific neighbourhood, using code described in the Example section below.
To specify which neighbourhood to display, the simplest way is to specify its
geog_id, which is a unique identifier for the neighbourhood, such as
g30_abcd1234. When you sign a contract with Local Logic for Local Profiles, we will provide you with the URL of a geography TSV file with all the geog_ids for the neighbourhoods you’ve requested.
Neighbourhood boundaries change more often than you might think. Because most neighbourhoods do not have legal definitions (unlike municipal and country boundaries), different people often have different opinions about where exactly a neighbourhood begins and ends.
When our clients disagree with our neighbourhood boundaries, we have a conversation about it, which may result in us deciding to modify our boundaries. This might mean adjusting the boundary shapes, adding new neighbourhoods, and/or deleting them.
For example, we might have a neighbourhood called Golden Fields. However, a client might like to differentiate between properties that are in the east part of the neighbourhood from those in the west. As such, we could split the neighbourhood in two: this would result in the addition of two new neighbourhoods: Golden Fields East and Golden Fields West. We may also decide to delete the original Golden Fields neighbourhood, or keep it as is.
If new neighbourhoods are added, you will need to generate new web pages for them. Similarly, if neighbourhoods are deleted, you’ll need to delete those pages, as their Local Profiles will no longer exist. To ensure that you always have pages for the latest neighbourhoods, and to avoid having pages where Local Profiles no longer appear, we recommend that you automatically query the geography TSV file (see Specifying neighbourhoods section above) nightly and refreshing / regenerating your neighbourhood web pages.
To test this example live, make sure to replace the
YOUR_TOKEN placeholder with the token we provided to you and the
YOUR_GOOGLE_KEY with your Google Maps API key.
⚠️ Local Profiles requires a
geogId value when
lng options are not provided. A
geogId can be retrieved by following two steps
Note: You should never expose your
client_secret in client-side code. All v3 API Authorization calls (to retrieve your OAuth token) should be made from your server."
Please note that if your basemap provider is not supported natively by the
Local Profiles SDK, it may still be supported via the
leafletMap option. In
this case, you will need to first find and implement the Leaflet Plugin
corresponding to the basemap you would like to use. You will then need to
instantiate a new Leaflet Map using the basemap as your
tileLayer. The Leaflet instance can be
passed to the SDK with the
leafletMap option. Please note that such a
configuration will be considered custom code, and only limited support options
may be available.
|geogId||required when ||Two alternative methods for specifying the geography (i.e. neighbourhood, borough, city, etc.) whose profile will be displayed.|
To obtain a full list of these IDs, reach out to your main contact at Local Logic, or email firstname.lastname@example.org
|lat||required when ||Geography latitude. A decimal number between -90 and 90|
|lng||required when ||Geography longitude. A decimal number between -180 and 180|
|googleMapsMap||optional||The Google Maps map instance you want the Local Profiles widget to be associated with.|
You must include either this option or
|leafletMap||optional||The Leaflet map instance you want the Local Profiles widget to be associated with.|
You must include either this option or
|basemap||optional||String value that specifies the basemap of the widget if you are using the |
|appleMapsType||optional||If you select the Apple basemap (|
|appleMapsToken||optional||If you select the (|
|defaultCategory||optional||Specifies which Location Scores category should be displayed when the Local Profiles widget loads.|
|defaultShowcase||optional||Specifies, for each Location Scores category tab, which Location Score is displayed when the tab opens.|
|color||optional||Hexadecimal color value used for the text and scores.|
|color2||optional||Hexadecimal color value used for the icon of the currently selected Location Score.|
|color3||optional||Hexadecimal color value used for the category section tabs.|
|maxInnerWidth||optional||Integer value specifying the width, in pixels, of the inner section of your web page.|
When this option is set, the map will fill the width of the widget. This option is ignored on mobile display, and when the width of the widget container is less than the value specified for
|hideProfileTexts||optional||Boolean value to specify whether the text component of the Local Profiles should be hidden or not.|