我目前正在尝试更改现有标记的颜色.
这是我的javascript代码:
$(".etablissement").mouseenter(function() {
var currentMarker = oMarkers[$(this).data("type")+"-"+$(this).data("id")];
var currentIcon = currentMarker.getIcon();
currentIcon = currentIcon.url;
var newIcon = {
url: currentIcon,
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(30, 30),
scaledSize:new google.maps.Size(40, 40),
fillColor: '#1077aa',
fillOpacity: 1,
strokeColor: '#1077aa'
};
currentMarker.setIcon(newIcon);
if(typeof oMarkers_panier[$(this).data("type")+"-"+$(this).data("id")] == 'undefined' || oMarkers_panier[$(this).data("id")] == null){
currentMarker.setIcon(newIcon);
}
oInfo[$(this).data("type")+"-"+$(this).data("id")].open(oMap, currentMarker);
currentMarker.setAnimation(google.maps.Animation.BOUNCE);
});
Run Code Online (Sandbox Code Playgroud)
我用getIcon()得到了标记的当前图标,然后我创建了一个具有相同图像但新颜色的新标记.问题是标记的颜色不会改变.我尝试用基本的.png更改整个图标,它可以工作,所以我不知道可能是什么问题.
这是我的svg代码:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" …Run Code Online (Sandbox Code Playgroud) 例如,我有这个简单的实体:
<?php
namespace App\Entity\Creator;
use App\Repository\Creator\ActivityContactRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ActivityContactRepository::class)]
#[ORM\Index(columns: ['contact_id'])]
class ActivityContact
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Activity::class, cascade: ['persist'])]
private Activity $activity;
#[ORM\Id]
#[ORM\Column(name: 'contact_id', type: 'integer')]
private int $contactId;
public function __construct(Activity $activity, int $contactId)
{
$this->activity = $activity;
$this->contactId = $contactId;
}
public function getActivity(): Activity
{
return $this->activity;
}
public function setActivity(Activity $activity): void
{
$this->activity = $activity;
}
public function getContactId(): int
{
return $this->contactId;
}
}
Run Code Online (Sandbox Code Playgroud)
当我生成“diff”迁移时,学说会自动创建一个查询来为“activity_id”列添加 MariaDB INDEX。
就我而言,该索引没有用,我想将其删除,而不仅仅是从迁移中删除它。
有没有办法指定不创建这个索引?
谢谢,
doctrine ×1
doctrine-orm ×1
icons ×1
javascript ×1
jquery ×1
mariadb ×1
marker ×1
php ×1
svg ×1
symfony ×1