I am trying to develop a map generation with points defined in advance by coordinates. First, information about points on the map is collected in an array in PHP:
$mapData['features'][]=array( "type"=>"Feature", "id"=>$numb, "geometry"=>array( "type"=>"Point", "coordinates"=> Array(55,55),//взял координаты для примера ), "options"=>Array( "iconLayout" => 'default#image', "iconImageHref" => '/images/icon.png', "iconImageSize" => Array(24, 30), "iconImageOffset" => Array(10,10), ), "properties"=>array( "balloonContentBody" => $contentBody, "balloonContentFooter"=>"", "iconCaption"=> $item['NAME'], 'iconContent' => '', "iconCaptionMaxWidth"=> '300', "hintContent"=>"<strong>".$item['NAME']."</strong>" ), ); Next, when the array is assembled, convert it to a javascript array and insert the maps into the script:
$(document).ready(function(){ ymaps.ready(init); }); function init () { var dataR=<?=CUtil::PhpToJSObject($JsonData)?>; var myMap = new ymaps.Map('map', { center: [55.50, 37.64], zoom: 10, controls:['zoomControl'] }, { searchControlProvider: 'yandex#search' }), objectManager = new ymaps.ObjectManager({ clusterize: false, gridSize: 32, clusterDisableClickZoom: true }); myMap.behaviors.disable('scrollZoom'); myMap.geoObjects.add(objectManager); objectManager.add(dataR); myMap.setBounds(objectManager.getBounds(), { checkZoomRange: true }); } The problem is that when I specify the creation of a custom icon for a label (element of the "options" array in the first course of the php code), it is generated, but nothing happens when I click on it - that is, the content of the "balun" does not open. As soon as we remove the "options" from the main array, everything starts working correctly with standard labels.
What is the problem, can someone tell?)