Skip to main content

Display premise location in google map. oracle utilities customer care and billing

This can be used as a reference only. ©
  1. You need to get a key from google, this key will be used in the google map javascript.Click on the below link to get the key.
     https://developers.google.com/maps/documentation/javascript/get-api-key

      2. Create a UI map which will hold the google map.
         Ui Map          : CmGoogleMap
         Ui Map Type : Complete Html Document

      3. UI Map Schema (find inline comment for more details)

<html>
  <head>
    <title>Geocoding service</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
width:600;
        height: 300;
      }
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 30%;
        margin: 0;
        padding: 0;
      }
  </style>
  </head>
  <body>
<script>
function myFunction(){
// alert('13292 Lake Ave NE, Hartville, OH, 44632');
//alert(top.model().getValue('PREM_INFO'));
}</script>
       <div id="map"></div>
    <script>
      function initMap() {
 myFunction();
        var map = new google.maps.Map(document.getElementById('map'), {
          zoom: 16,
height: 50,
width:50,
          center: {lat: -34.397, lng: 150.644}
        });
map.setTilt(45);
        var geocoder = new google.maps.Geocoder();
  /* get the address from page data model */
var address=top.model().getValue('PREM_INFO');
/* convert address to longitude and latitude */
         geocodeAddress(geocoder, map, address );
         }
      function geocodeAddress(geocoder, resultsMap, address ) {
        //var address = '10820 Mogadore Ave NW,44685,usa';
        geocoder.geocode({'address': address}, function(results, status) {
          if (status === 'OK') {
            resultsMap.setCenter(results[0].geometry.location);
            var marker = new google.maps.Marker({
              map: resultsMap,
              position: results[0].geometry.location
            });
          } else {
            alert('Geocode was not successful for the following reason: ' + status);
          }
        });
      }
    </script>
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key="###########PASTE YOUR API KEY HERE########################">
    </script>
<div id="premiseId" oraField="premiseId"></div>
  </body>
<xml>
</xml>
</html>   

4. Add explicit map zone

5. Add The above zone to premise portal

6. Test Your code (Search any premise and go to premise portal)


😅😆😇

Comments

  1. Thank you! Any plans to release new customization? Maybe Twitter feed integration?

    ReplyDelete

Post a Comment

Popular posts from this blog

Configure eclipse for remote debugging in web logic server ,Oracle utilities customer care and billing cc&b

Below is the step to configure the eclipse IDE to remotely debug various customization like change handler, algorithm, batch... 1. open the ENVIRON.ini file. This file exists in the path $SPLBASE\etc\ 2. Find property WEB_ADDITIONAL_OPT and add the below argument. -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n here port no is 8000, you can change as per your convenient. do not use port no that is already used like 6500,1521. 3. Now Run the initial setup to reflect the changes. 4. start the spl and you will get the below highlighted message. 5. Open eclipse to configure the port no for debug. go to debug menu--->debug configuration Click on Remote java application---Click on new Enter Host     : localhost           Port     : 8000(port no you configured in previous steps) Click on the apply button. Go to debug perspective and you see eclipse is connect...