Map()
The map object is responsible for rendering a map in a container with a set of options.
press
The map was clicked/touched. Contains coordinates of the event point. Fired only if the target is the map itself.long-press
The map registered a long click/touch. Contains coordinates of the event point. Fired only if the target is the map itself.map-press
The map was clicked/touched. Contains coordinates of the event point. Is always fired when clicking within map container, no matter the target.view-reset
The map was moved at a specified location and zoom levelmove-start
The map will be moved by panningmove
The map is being moved by panningmove-end
Panning of the map has stoppedlayer-add
A new layer was added to the maplayer-remove
A layer was removed from the maplayer-moved
A layer's position (z-index) on the map was changedzoom-interval-change
The available maximum and minimum zoom levels were changedzoom-change
The map zoom levels were changedgeolocated
The browser retrieved the user's geolocation
Parameter | Type | Description |
---|---|---|
container | HTMLDiv | The html div where the map will be rendered |
options | Object | The options to set for the map's initial rendering |
Example
$(document).ready(function () {
var mapContainer = $("#map")[0],
mapoLayer = new T.TibcoLayer();
var map = new T.Map(
mapContainer,
{
zoom: 3,
center: new T.LatLng(46, 2),
controls: {
attribution: {
prefix: "<a href=''>©TIBCO</a>"
}
}
}
);
map.addLayer(mapoLayer);
});
<html>
<head>
<title>TibcoMaps - Simple map</title>
<meta charset="UTF-8">
<!-- CSS -->
<link rel="stylesheet", href="map.css"/>
<!-- Javascript -->
<script type="text/javascript" src='../lib/GeoAnalytics.js'></script>
<script type="text/javascript" src='../lib/jquery-1.9.1.min.js'></script>
<script type="text/javascript" src="map.js"></script>
</head>
<body>
<div class="custom-container">
<div id="map"></div>
</div>
</body>
</html>
body, html {
height: 100%;
width: 100%;
margin: 0px;
}
.custom-container {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
#map {
width: 100%;
height: 100%;
}