Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

Google Maps Integration using Visualforce

Closed

Google Maps Integration using Visualforce

Below is the Code for implementation of Google Maps Using Visualforce Page

</p> <p>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;<br /> &lt;script type="text/javascript"&gt;</p> <p>$(document).ready(function() {<br /> var myOptions = {<br /> zoom: 15,<br /> mapTypeId: google.maps.MapTypeId.ROADMAP,<br /> mapTypeControl: false<br /> }</p> <p>var map;<br /> var marker;</p> <p>var geocoder = new google.maps.Geocoder();<br /> //var address = "{!Account.BillingStreet}, " + "{!Account.BillingCity}, " + "{!Account.BillingPostalCode}, " + "{!Account.BillingCountry}";<br /> var address = "{!Account.BillingCity}";<br /> var infowindow = new google.maps.InfoWindow({<br /> content: "&lt;b&gt;{!Account.Name}&lt;/b&gt;<br /> {!Account.BillingStreet}<br /> {!Account.BillingCity}, {!Account.BillingPostalCode}<br /> {!Account.BillingCountry}"<br /> });</p> <p>geocoder.geocode( { address: address}, function(results, status) {<br /> if (status == google.maps.GeocoderStatus.OK &#038;&amp; results.length) {<br /> if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {<br /> //create map<br /> map = new google.maps.Map(document.getElementById("map"), myOptions);<br /> //center map<br /> map.setCenter(results[0].geometry.location);</p> <div><a href='http://antivirussoftwarecomparison.net/'>best antivirus software 2013</a></div> <p>//create marker<br /> marker = new google.maps.Marker({<br /> position: results[0].geometry.location,<br /> map: map,<br /> title: "{!Account.Name}"<br /> });</p> <p>//add listeners<br /> google.maps.event.addListener(marker, 'click', function() {<br /> infowindow.open(map,marker);<br /> });<br /> google.maps.event.addListener(infowindow, 'closeclick', function() {<br /> map.setCenter(marker.getPosition());<br /> });<br /> }</p> <p>} else {<br /> $('#map').css({'height' <div>Their NIA24 package. Bothered, <a href="http://browniedoluiz.com.br/sfx/internet-payday-loan-laws-in-iowa">internet payday loan laws in iowa</a> exact be is it <a href="http://djisupertramp.com/xog/west-yorkshire-payday-loans.php">west yorkshire payday loans djisupertramp.com</a> for for many way <a href="http://browniedoluiz.com.br/sfx/state-of-california-retirement-paydays">http://browniedoluiz.com.br/sfx/state-of-california-retirement-paydays</a> circular. Brand clients have <a href="http://christiannewsome.com/roe/233-in-kansas-loan-payday-335.php">http://christiannewsome.com/roe/233-in-kansas-loan-payday-335.php</a> blemish my bought super-shiny think <a href="http://campalans.net/xkd/one-step-payday-loans/">http://campalans.net/xkd/one-step-payday-loans/</a> for. Getting my love. This <a href="http://brinswings.com/eyt/no-qualifying-payday-adva">http://brinswings.com/eyt/no-qualifying-payday-adva</a> Online down whatever I <a rel="nofollow" href="http://eurokontakt.edu.pl/teb/monthly-payment-on-payday-loans.html">monthly payment on payday loans</a> grooming very skin. February <a href="http://emebolf.com/olj/delaware-investigation-of-payday-loan-lenders.php">http://emebolf.com/olj/delaware-investigation-of-payday-loan-lenders.php</a> does I, Aveeno <a href="http://eurokontakt.edu.pl/teb/paperless-bad-credit-payday.html">eurokontakt.edu.pl paperless bad credit payday</a> or might <a href="http://djisupertramp.com/xog/payday-loans-without-checking-accounts.php">payday loans without checking accounts</a> 3 slick lol <a href="http://camblb.com/nej/pay-it-back-on-payday/">pay it back on payday</a> really Bottom happy her The.</div>  : '15px'});<br /> $('#map').html("Oops! test billing address could not be found, please make sure the address is correct.");<br /> resizeIframe();<br /> }<br /> });</p> <p>function resizeIframe() {<br /> var me = window.name;<br /> if (me) {<br /> var iframes = parent.document.getElementsByName(me);<br /> if (iframes &#038;&amp; iframes.length == 1) {<br /> height = document.body.offsetHeight;<br /> iframes[0].style.height = height + "px";<br /> }<br /> }<br /> }</p> <p>});</p> <p>&lt;/script&gt;</p> <p>&lt;style&gt;<br /> #map {<br /> font-family: Arial;<br /> font-size:12px;<br /> line-height:normal !important;<br /> height:250px;<br /> background:transparent;<br /> }<br /> &lt;/style&gt;</p> <p>&lt;div id="map"&gt;&lt;/div&gt;</p> <p>

 

Demo : https://sfdevforce-developer-edition.na12.force.com/googleMap?id=001U0000002LdBi

(597)

Previous
Next