Point objects |
EMAPI.Object.PointObject - the class of point's objects placed on the map on the layer's form of {EMAPI.VectorLayer} type.These objects can be visualized in the form of icons.
Adding object point:
obj.push(new EMAPI.Object.PointObject( { name: 'Point', label: 'Point 1', labelVisible: true, labelXOffset: 25, labelYOffset: -35, fontSize: 16, fontFamily: 'arial', lonLat: new EMAPI.LonLat(19.457817, 51.759553), externalGraphic: 'index.png', graphicWidth: 11, graphicHeight: 23, graphicXOffset: -5, graphicYOffset: -23 })); //add a point's object called 'Point'
where:
name | {String} Name of the object shown in the information window. |
label | {String} The label's object on the map. |
labelVisible | {Boolean} Information about the visibility of the object's name on the map (by default false). |
labelXOffset | {Integer} Additional horizontal label's shift with the name (by default 0). |
labelYOffset | {Integer} Additional vertical label's shift with the name (by default 15). |
fontSize | {String} The font size for the label with the name of the object on the map (by default 12px). |
fontFamily | {String} Font name for the label with the name of the object on the map (by default Courier New). |
lonLat | {EMAPI.LonLat} Coordinates of the center point of an object. |
externalGraphic | {String} URL of the main object icon. |
graphicXOffset | {Integer} Horizontal shift external Graphic icon in relation to its position (by default 0). |
graphicYOffset | {Integer} Vertical shift external Graphic icon in relation to its position (by default 0). |
graphicWidtht | {Integer} the width of the icon (by default 10). |
graphicHeight | {Integer} the height of the icon (by default10). |
An example of using:
var layer = new EMAPI.VectorLayer('warstwa 1'); //creates new layer 'layer' map.addLayer(layer); //add a layer of 'layer' to the map var obj = new Array(); //creating a new array of objects 'obj' obj.push(new EMAPI.Object.PointObject({name:'Point 1', label: 'Point 1', labelVisible: true, labelXOffset:25, labelYOffset:-35, fontSize: 16, fontFamily: 'arial', lonLat:new EMAPI.LonLat(19.457817, 51.759553), externalGraphic:'wskaznik.png', graphicWidth:11, graphicHeight:23, graphicXOffset:-5, graphicYOffset:-23})); //adds a point's object 'Point 1' obj.push(new EMAPI.Object.PointObject( {name:'Point 2', label: 'Point 2', labelVisible: true, labelXOffset:25, labelYOffset:-35, fontSize: 16, fontFamily: 'arial', lonLat:new EMAPI.LonLat(19.459917, 51.761553), externalGraphic: 'wskaznik.png', graphicWidth:11, graphicHeight:23, graphicXOffset:-5, graphicYOffset:-23})); //adds a point's object 'Point 2' layer.addObjects(obj) // adds objects from an array'obj' to the layer 'layer'