MapChart.getGMapDomNode

Syntax

getGMapDomNode();

Description

The getGMapDomNode method returns DOM item of the Google map topobase.

Comments

The method returns an HTMLElement value.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). A map with the Google topobase must also be loaded (see page with description of the MapChart.afterGoogleLoad property).

Find URL of the shown Google map fragment, and set a border for this map:

// Check whether the map is loaded
if (map.isLoaded) {
    // Get the object with the Google map settings
    var googleMap = map.getGoogleMap();
    if (googleMap != null) {
        // Find URL of the shown map
        console.log("URL of the shown map fragment: " + googleMap.mapUrl);
        // Get the DO< item of the Google map
        var gMapDomNode = map.getGMapDomNode();
        // Determine the border for the DOM item
        gMapDomNode.style.borderColor = PP.Color.Colors.black;
        gMapDomNode.style.borderWidth = 5;
        gMapDomNode.style.borderStyle = "double";
    } else {
        console.log("Google map is not loaded");
    }
} else {
    console.log("The map has not been loaded yet");
};
// Check whether map contains selected items
console.log(map.isSomethingSelected() ? "Map contains selected items" : "Map items are not selected");

After executing the example the browser console displays URL of the shown Google map fragment:

URL of the shown map fragment: http://maps.google.com/maps?ll=68.978625,104.861216&z=1&t=m&hl=en-US&mapclient=apiv3
 

Map border is set as a double solid black line:

See also:

MapChart