Geopointe

Creating a Static Map with Salesforce Maps

With the June '15 release of Geopointe, we had to deprecate our static maps. However, the same functionality can be achieved using the Salesforce Maps functionality.

To do so, you'll want to create a new VisualForce page. This is done in Salesforce Setup | Develop | Pages | New. Give the page a name you will recognize once you're ready to add it to your page layout.

Below is sample code of what it would look like to implement a static map clickable out to a Geopointe map:
 
<apex:page standardController="Account" showHeader="false" sidebar="false" cache="false">
    <style type="text/css" media="all">
        body{margin: 0; padding: 0;}
    </style>
   
    <div style="cursor: pointer; width: 100%; height: 300px; position: absolute; z-index: 1000;" onclick="window.top.location.href = '/apex/geopointe__Map?id={!Account.Id}'"></div>
   
    <div style="margin: 5px auto; width: 85%;">
        <apex:map width="100%" height="300px" mapType="roadmap" zoomLevel="15">
            <apex:mapMarker position="{latitude:{!account.geopointe__geocode__r.geopointe__Latitude__c},longitude:{!account.geopointe__geocode__r.geopointe__Longitude__c}}"/>
        </apex:map>   
    </div>
       
</apex:page>

‚ÄčThis code should work for an account. To adjust it for other objects, you may need to change the following:

Account - Where you see the word Account, replace with the api name of the object you want. Note: for custom objects, that will include "__c" at the end.

geopointe__geocode__r.geopointe__Longitude__c and account.geopointe__geocode__r.geopointe__Latitude__c - This will be correct for a standard object. Custom objects—where you created your own geocode field—would not include the geopointe namespace. Likely, it will be only geocode__r.geopointe__Longitude__c.

Once you have completed and saved your Visualforce, you'll want to go to the page layout(s) and add this onto your layout. You'll find it underneath "Visualforce Pages."