top

SFMAPS

** This class will not be supported in 2015.

   All functionalities of sfMaps class are more improved, integrating with CAPH. Therefore sfMaps class is not supported since 2015 Smart TV. To use functions of sfMaps class, refer to here.


This is the class for Maps UI components.

Add the following line for sfMaps class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/af/2.0.0/loader.js">/script>

You can declare sfMaps class like this :

  ex) $('#div ID').sfMaps('method Name', parm1, parm2);

       $('#div ID').sfMaps({ Json type });


Methods

addInfoWindow

Description
This function adds InfoWindow.
Parameters
■options 
  - Object
  - The InfoWindow options 
   * position
    - Array<Number>
    - Point of the map to show the InfoWindow. [Latitude, Longitude] 
   * content 
    - String
    - Content of InfoWindow
Return■Object
  - InfoWindow object
  - This object supports the remove() method to remove the InfoWindow.
Emulator SupportN
SDK ConstraintNone
Example
this.aGoogleMapsWins.push($("#maps").sfMaps('addInfoWindow', {
    location: $("#maps").sfMaps('getCenter'),
    content: '<div style="text-align:center;"> MAPS TEST</div>'
   }));
   break;

addMarker

Description
This function adss Marker.
Parameters
■options
  - Object 
  - The marker options 
   * position : (Array<Number>) Point of the map to mark. [Latitude, Longitude] 
   * image (Object) {url:<String>, anchorpos:[<Number>, <Number>]}. (Optional)
Return■Object
  - marker object
  - This object supports remove() method to remove the marker.
Emulator SupportN
SDK ConstraintNone
Example
var marker = $("#maps").sfMaps('addMarker', {
        position: $("#maps").sfMaps('getCenter')
    });

getCenter

Description
This function gets current map center coordinate.
Parameters
none
Return■Array
  - Number
  - First element is latitude and seconds one is longitude
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('getCenter');

getMapType

Description
This function gets current map type.
Parameters
none
Return■String
  - The map type
  - Map type of Google Maps API
   * value :‘roadmap’, ‘hybrid’, ‘satellite’, ‘terrain’
Emulator SupportN
SDK ConstraintNone
Example
$("#mapsreturn").html("Current Map Type : " + $("#maps").sfMaps('getMapType'));

getZoom

Description
This function gets current ratio of expansion.
Parameters
none
Return■Number
  - Current zoom level of the map
Emulator SupportN
SDK ConstraintNone
Example
$("#mapsreturn").html("Zoomlevel : " + $("#maps").sfMaps('getZoom'));

moveBy

Description
This function moves the map by left, right, up, down direction.
Parameters
■option 
  - Object 
  - Indicates directions of panning. 
   * x 
  - Number
  - x-axis (Horizontal) movement (Pixel). Positive number indicates rightward direction of the map. 
   * y 
  -  Number
  - y-axis (Vertical) movement (Pixel). Positive number indicates downward direction of the map. 
   * animate 
  - Boolean
  - Indicates whether to animate the movement.
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('moveBy', {x: -200, y: 0, animate: true});

moveTo

Description
This function moves the location of map to left, right, up, down direction. (Animated)
Parameters
■options
  - Object
  - Indicates coordination of center to move. 
   * center 
  - Array<Number> 
  - Center of the map to move. [Latitude, Longitude]
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('moveTo', {
    center: [37.259, 127.054]   
});
Description
This function searches strings on the map.
Parameters
■options
  - Object
  - Geocode options 
   * address : (String) Query string to search. (Optional)
   * location : (Array) Postion about which to search. (Optional) 
   * callback : (Function(Object)) Callback function to be called when searching is completed
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('search', {
    location: $("#maps").sfMaps('getCenter'),
    callback: function (result) {
     alert("Search Callback");
     if (result) {
      $("#maps").sfMaps('setCenter', {
       center: result.location
      });

setCenter

Description
This function sets the center of the map.
Parameters
■options 
  - Object
  - Indicates center of the map to move. 
   * center
  - Array
  - center of the map to move [Latitude, Longitude].
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('setCenter', {
          center: [37.259, 127.054]   // Coordinate of Samsung HQ
      });

setMapType

Description
This function sets map type.
Parameters
■ options
  - Object
  - Indicates the type of the map. 
   * type
    - String
    - Map types of Google Maps API: ‘roadmap’, ‘hybrid’, ‘satellite’, ‘terrain’.
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('setMapType', {type: this.mapTypesGoogle[this.iGoogleSelMapType]});

setZoom

Description
This function sets expansion ratio.
Parameters
■ options
  - Object
  - Indicates directions of panning. 
   * zoom
    - Number
    - The zoom level of the map.
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('setZoom', {zoom: 5});

zoomIn

Description
This function zooms in the map.
Parameters
none
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('zoomIn');

zoomOut

Description
This function zooms out the map.
Parameters
none
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
$("#maps").sfMaps('zoomOut');