Code Monkey home page Code Monkey logo

johnsfdemo / esri-map-areas Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 3.0 18.93 MB

This package contains a Lightning component that draws polygons read from a Salesforce related list onto an Esri map embedded in a record page. The component allows the user to choose between street, topological, and satellite views of the map.

JavaScript 94.96% Apex 5.04%
salesforce-developers salesforce-lightning salesforce-apex leafletjs maps salesforce-lightning-components

esri-map-areas's Introduction

Esri Map Areas

This package contains a Lightning component that draws polygons read from a Salesforce related list onto an Esri map embedded in a record page. The component allows the user to choose between street, topological, and satellite views of the map.

EsriMapAreas in Action

Configuration

The component pulls coordinates from records in a related list. The related list object can be any Salesforce object, but must contain the following custom fields:

Field API Name Description
Item_Color__c The color of the polygon to be drawn using standard HTML/CSS format. For example, red or #f48723.
Coordinates__c A comma-separated list of two-member latitude/longitude arrays in JSON format that represent the polygon to be drawn on the map: [lat-1,lon-1],[lat-2,lon-2],...[lat-n,lon-n]
Formatted_Tab_URL__c A string that should evaluate to a URL path name (without the "https" or server portion, for portability) that will take the user to this record's page. I use a formula field to generate this based on the object API name and ID field: "/lightning/r/Property__c/" & Id & "/view"

The package includes a sample object called Property__c which contains all of the required fields. You can either use it as a reference or as a starting point for your own custom object (or even delete it altogether; it is not required by any other part of the package):

Sample Related List Object

From here, you can simply drag the component onto a Lightning App Builder page:

Lightning App Builder Page

Most of the properties of the component default to reasonable values, but you must supply these two:

  • The API name of the related list object that contains the required fields described above.
  • The API name of the lookup field on the related list object that looks up to this object.

You may also specify up to nine additional fields to be displayed on the related list from the related list object. The strings in the component properties must be a "|"-separated sequence consisting of

  • (Required) The column header for the field you would like to show.
  • (Required) The API name of the field on the related object for that column.
  • (Required) A type string that identifies a type property of the Lightning datatable specification; for example, number, text, date, etc.
  • An optional JSON string that contains cellAttributes for the column in a form consistent with the Lightning datatable specification.
  • An optional JSON string that contains typeAttributes for the column in a form consistent with the Lightning datatable specification.

For example, the string for the purchase date column for the properties example above is:

Date Purchased|Date_Purchased__c|date|"alignment":"center"|"day":"numeric","month":"long","year":"numeric"

and the string for the acreage column is:

Acreage|Acreage__c|number|"alignment":"center"||

You can optionally sort the related list based on any field in the related list object in either ascending or descending order.

How to Deploy This Package to Your Org

I am a pre-sales Solutions Engineer for Salesforce and I develop solutions for my customers to demonstrate the capabilities of the amazing Salesforce platform. This package represents functionality that I have used for demonstration purposes and the content herein is definitely not ready for actual production use; specifically, it has not been tested extensively nor has it been written with security and access controls in mind. By installing this package, you assume all risk for any consequences and agree not to hold me or my company liable. If you are OK with that ...

Simply click the button below and log into your org:

Deploy to Salesforce

References

Credits

This component was inspired by the work done by John Schillaci at Salesforce.

esri-map-areas's People

Contributors

johnsfdemo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.