Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to display list of accounts on google map in salesforce?

    Tagged: Account, Google Map, List, Salesforce Development

    • Salesforce® Discussions

      How to display list of accounts on google map in salesforce?

      Posted by Vikas Kumar on January 30, 2017 at 2:45 PM

      Hi All,

      I wanted to show list of accounts on google map using their corresponding address

      can provide some suggestions

      thanks

      Aakash replied 6 years, 8 months ago 4 Members · 3 Replies
      • Account
      • Google Map
      • List
      • Salesforce Development
    • 3 Replies
    • sushant

      Member
      January 31, 2017 at 1:48 PM

      Hi Vikas,

      <apex:page standardController="Account">
      <apex:pageBlock >
      <head>

      <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
      <script type="text/javascript">

      $(document).ready(function() {

      var myOptions = {
      zoom: 20,
      mapTypeId: google.maps.MapTypeId.HYBRID,
      mapTypeControl: true
      }

      var map;
      var marker;

      var geocoder = new google.maps.Geocoder();
      var address = "{!Account.Project_Street_Address__c}, " + "{!Account.Project_City__c}, " + "{!Account.Project_Zipcode__c}";

      var infowindow = new google.maps.InfoWindow({
      content: "<b>{!Account.Name}</b>"
      });

      geocoder.geocode( { address: address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {

      //create map
      map = new google.maps.Map(document.getElementById("map"), myOptions);

      //center map
      map.setCenter(results[0].geometry.location);

      //create marker
      marker = new google.maps.Marker({
      position: results[0].geometry.location,
      map: map,
      title: "{!Account.Name}"
      });

      //add listeners
      google.maps.event.addListener(marker, 'click', function() {
      infowindow.open(map,marker);
      });
      google.maps.event.addListener(infowindow, 'closeclick', function() {
      map.setCenter(marker.getPosition());
      });

      }

      } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! {!Account.Name}'s address could not be found, please make sure the address is correct.");
      resizeIframe();
      }
      });

      function resizeIframe() {
      var me = window.name;
      if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
      height = document.body.offsetHeight;
      iframes[0].style.height = height + "px";
      }
      }
      }

      });
      </script>

      <style>
      #map {
      font-family: Arial;
      font-size:12px;
      line-height:normal !important;
      height:500px;
      background:transparent;
      }
      </style>

      </head>

      <body>
      <div id="map"></div>
      </body>
      </apex:pageBlock>
      </apex:page>

      Hope this helps you.

      Thanks

    • Fenil

      Member
      May 15, 2019 at 5:32 PM

      Hello Sushant

      i completely understand the code but how to execute it...

      is there any way to open Google map in salesforce

      as soon as i click on preview button for visualforce page it show's address not found

       

    • Aakash

      Member
      May 27, 2019 at 10:45 AM

      Right now the most successful running Salesforce courses are on Udemy. Why they are successful is due to their cost, Udemy runs regular sale promotions and a course priced at $200 is available for $10 also you can find coupons for those. However the problem with such market places is that the courses are very shallow and at high level. You can find several such feedback on platforms like reddit where people say that that the course was good but after taking the course they are not able to perform on Job.

      People will give feedback that the course is good but does not go in deep. But why people give positive review even though the course lacks quality content. This is what most people do not understand. People get fascinated by the Audio and Video quality but what they do not understand is that after taking such courses they will not be able to sustain in the work they will have to get embarrassed in real world. Lot of people whom I know have taken these courses and everyone has complained the courses are very shallow. But then again its not our fault, Udemy invests a lot in marketing and promotion and is a big brand now. It is really good at what it does but there are lots of other great courses as well, which do not get noticed because they do not work on promotion . They believe in course quality and word of mouth promotion.

      Trailhead is a good resource too, because its free. But there are no instructors. Why do we need schools and colleges when already have books which we can go through on our own, complete the exercises in the end and voila. But we all know it doesn't work like this in practical world.

      I have been there and done that. These courses are step by step hands on and go very deep in each topic. Trust me you will learn much much more then you can expect.

      If you really want to know about best courses on Salesforce then they are here. http://www.digibask.com/

      They go very deep and you will feel as if you are sitting in a live classroom. Also each course covers real life projects in the end. I recommend this for both experienced and Freshers.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Steps to Insert Quick Text In Salesforce

    Steps to Insert Quick Text In Salesforce

    Blog in Salesforce Implementation

    Quick text is predefined messages, like greetings, answers to common questions, and short notes. One can insert quick text in the case feed publisher, emails,…

    How to insert Quick Text, Quick Text in Salesforce, Salesforce Implementation, Setup Quick Text
    Ratnakar Mar 16, 2018
    18,929  Views
    Page Reference in Lightning

    Page Reference in Lightning | Salesforce Lightning Tutorial

    Blog in Lightning

    The force:navigateToComponent tag will be deprecated after Summer 18 because it is no longer in use. From now on, You may now control which Lightning…

    API, Apps, Custom Component, Lightning Apps, Lightning Components
    Arpit Singhal Apr 12, 2022
    12,572  Views
    Workbench in Salesforce

    How to Use Workbench in Salesforce | Developer Guide

    Blog in Others

    Workbench can be a web-based tool that helps administrators and developers to act with Salesforce for information Insert, Update, Upsert, Delete, and Export. It in…

    API, Bulk CSV, Case House Owners, Case Object, Case Owner Field
    Ratnesh Oct 9, 2020
    4,958  Views

    Popular Salesforce Videos

    Salesforce To RDS Integration Through Dell Boomi | Salesforce Tutorial

    Salesforce To RDS Integration Through Dell Boomi | Salesforce Tutorial

    Video in Salesforce Integration, Salesforce Training

    Salesforce to RDS integration through Dell Boomi. This tutorial will cover the following points - 1. Introduction Take a quick glimpse at integrating accounts from…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Dell Boomi
    Algoworks Dec 23, 2020
    2,932  Views
    Overview of Salesforce Development Course | Learn Salesforce Development From Scratch

    Overview of Salesforce Development Course | Learn Salesforce Development From Scratch

    Video in Salesforce Training, Salesforce Development

    In this video, Shrey has given a detailed overview of the Salesforce Development Course. You will learn the following topics from this course: Salesforce Development…

    Salesforce Training, Visualforce, Learn Salesforce Development, SOQL, Apex Basics
    Jogender Jun 22, 2021
    1,645  Views
    How I Really Feel About Salesforce

    How I Really Feel About Salesforce

    Video in Salesforce Stories

    A deep dive into the state of the Salesforce industry in 2021, such as: - Is Salesforce going to crash in the foreseeable future? -…

    Salesforce Training, salesforce, Salesforce Industry, Salesforce Video, Salesforce Learning
    Nauman Aug 31, 2021
    2,350  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.