function contentInsertPlacemark(current) {
var res='Форма для новой метки'+
if (current){';
res += 'lng:'+current.getLng() +
'<br />lat:'+current.getLat();
};
Return res;
}
$functionText1 = '';
$functionText1 .= 'insertPlacemark.setGeoPoint(current);' ."\n";
$functionText1 .= 'insertPlacemark.setBalloonContent(contentInsertPlacemark(current));'."\n";
//функция contentInsertPlacemark(current) должна быть глобальной, поэтому выносим в начало скрипта
$scripttext = $functionText . $scripttext;
$scripttext .= 'YMaps.Events.observe(insertPlacemark, insertPlacemark.Events.Drag, function (obj) {' ."\n";
$scripttext .= ' var current = obj.getGeoPoint().copy();' ."\n";
$scripttext .= $functionText1;
$scripttext .= '});' ."\n";
$scripttext .= ' geoResult = this.get(0);' ."\n";
$scripttext .= ' geoResult.setOptions({draggable: true});' ."\n";
$scripttext .= ' map.addOverlay(geoResult);' ."\n";
$scripttext .= ' map.setBounds(geoResult.getBounds());' ."\n";
// add route
if (isset($this->item->findroute) && (int)$this->item->findroute == 1)
{
$scripttext .= ' getMyMapRoute(geoResult.getGeoPoint()); '."\n";
}
// end add route
$scripttext .= ' var current = geoResult.getGeoPoint().copy();' ."\n";
$scripttext .= ' geoResult.setBalloonContent(contentInsertPlacemark(current));'."\n";
// Далее еще надо описать события на перетаскивание и открытие балуна, если есть необходимость.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
z00m wrote: Дмитрий, почему бы не сделать так что б при включении "Ввод маркеров пользователями" не отображалось инфо "Вы не вошли в систему" или "Вы вошли в систему как ..."
Ну на крайний случай заключить эти строчки в отдельный див, что б можно было их не отображать при display:none;
В некоторых ситуациях немного лишняя инфа на мой взгляд...
Please Log in or Create an account to join the conversation.
© 2011- Жук Це-Це. Design by Dmitry Zhuk