how can i change cluster icon? i wolud like to have same icon, with some other color than blue.
You need to use styles parameter when initializing MarkerClusterer object - the code below shows default styles so if you want to recolour one of the icons just change the relevant url to your image...
//set style options for marker clusters (these are the default styles)
mcOptions = {styles: [{
height: 53,
url: "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png",
width: 53
},
{
height: 56,
url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m2.png",
width: 56
},
{
height: 66,
url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m3.png",
width: 66
},
{
height: 78,
url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m4.png",
width: 78
},
{
height: 90,
url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m5.png",
width: 90
}]}
//init clusterer with your options
var mc = new MarkerClusterer(map, markers, mcOptions);
Google changed his repo. Latest cluster repo is: https://github.com/googlemaps/js-marker-clusterer
images : https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images
You may also consider downloading source and give link from your local path. This way you will have more control of resources your application needs.
local_path "/pucblic/"
mcOptions = {styles: [{
height: 53,
url: local_path+"m1.png",
width: 53
},
{
height: 56,
url: local_path+"m2.png",
width: 56
},
{
height: 66,
url: local_path+"m3.png",
width: 66
},
{
height: 78,
url: local_path+"m4.png",
width: 78
},
{
height: 90,
url: local_path+"m5.png",
width: 90
}]}
A shortcut is overriding the image path like this:
MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
"https://raw.githubusercontent.com/googlemaps/v3-utility-library/master/markerclustererplus/images/m";
Here are the original photos
markerClusterOptions = {styles: [{
height: 53,
url: "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m1.png",
width: 53
},
{
height: 56,
url: "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m2.png",
width: 56
},
{
height: 66,
url: "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m3.png",
width: 66
},
{
height: 78,
url: "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m4.png",
width: 78
},
{
height: 90,
url: "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m5.png,
width: 90
}]}
markerCluster = new MarkerClusterer(map, markers,markerClusterOptions);
Related
I'm trying to position a radar chart using chart.js. My chart is outputting aligned to the right.
I've tried setting the container to width: 100%, text-align: center and margin: 0 auto but the output is still not correct.
Code:
<div class="chartholder">
<canvas id="myChart" width="400" height="400"></canvas>
</div>
<script>
var ctx = document.getElementById("myChart").getContext('2d');
var marksData = {
labels: ["Digital Product Definition", "Digital Thread", "Digital Twin", "Digital Innovation Platform", "Top Performers", "Others"],
datasets: [{
label: "Your Company",
backgroundColor: "rgba(200,0,0,0.2)",
data: [4.8,7.2,9.6,7.2, 4, 2]
}]
};
var radarChart = new Chart(ctx, {
type: 'radar',
data: marksData
});
var chartOptions = {
scale: {
ticks: {
beginAtZero: true,
min: 0,
max: 10,
stepSize: 1
},
pointLabels: {
fontSize: 18
}
},
legend: {
position: 'left'
},
responsive: true,
};
var radarChart = new Chart(ctx, {
type: 'radar',
data: marksData,
options: chartOptions
});
</script>
CSS
canvas {
margin: 0 auto!important;
width: 100%;
height: auto;
}
.chartholder {
text-align: center;
width: 100%;
margin: 0 auto;
background-color: blue;
}
Screenshot of the output. The yellow is just to show the alignment better.
I used custom image for map marker but scss settings is not effective. I don't understand what is wrong with that.
CurrentMarker(location) {
let content: any;
let image = 'assets/img/start.svg';
let marker = new google.maps.Marker({
map: this.map,
animation: google.maps.Animation.DROP,
position: location,
icon: image
});
}
scss
page-mapmodal {
background: rgb(229, 227, 223);
#map {
width: 100%;
height: 100%;
}
#map .gmnoprint img {
width: 60px;
height: 80px;
}
the output
As you can see marker as same size as is.
I used fallowing code:
var icon = {
url: 'assets/img/target.svg',
scaledSize: new google.maps.Size(50, 50),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(0, 0)
};
We are trying to develop a progress bar in which we have to align a text on top of button. We tried using different layouts but its not coming. Can some suggest a way to do it using CSS if possible. Attaching the example here.
CSS should solve your problem, this is a bit hard-coded and won't work as a generic solution but you can start from here:
First let's create a panel with progress bars and a button between them:
Ext.create('Ext.panel.Panel', {
renderTo: document.body,
height: 100,
layout: {
type: 'hbox',
align: 'middle'
},
defaults: {
margin: 2
},
items: [{
xtype: 'progressbar',
style: {
borderRadius: '5px'
},
height: 10,
width: 200,
text: ' ',
value: 1
}, {
xtype: 'container',
cls: 'btnWrapper',
items: [{
xtype: 'button',
height: 30,
cls: 'fa fa-check',
style: {
color: 'white'
}
}]
}, {
xtype: 'progressbar',
style: {
borderRadius: '5px'
},
height: 10,
text: ' ',
width: 200
}]
});
And here is the CSS to take care of the rest:
<style>
.btnWrapper:before {
content: 'BASICS';
font-weight: bold;
position: absolute;
top: -20px;
left: -10px;
width: 100%;
color: orange;
text-align: center;
}
.btnWrapper .x-btn {
border-radius: 30px;
}
</style>
Fiddle: https://fiddle.sencha.com/#view/editor&fiddle/21n5
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
In my jqGrid, I want to have empty values in my grid...
Instead I am getting 1/1/0001
my model types for the dateTime are all nullable.
Am I missing something???
this is the code...
public DateTime? DischargeDateTime { get; set; }
What do you guys recommend?
tableToGrid("#frTable", {
cmTemplate: { sortable: false },
caption: '#TempData["POPNAME"]' + ' Population',
height: '400',
gridview: true,
shrinkToFit: false,
autowidth: true,
colNames: ['Edit',
'MRN',
'Hospital Fin',
'First Name',
'Last Name',
'Date of birth',
'Completed Pathway',
'Completed Pathway Reason',
'PCP Appointment',
'Specialist Appointment',
'Admit Date',
'Discharge Date',
'Discharge Disposition',
'Discharge To',
'Discharge Advocate Call',
'Home Healthcare',
'Safe Landing Accepted',
'PCP Name',
'PCP Phone',
'PCP Appointment Location',
'Specialist Name',
'Specialist Phone',
'Specialist Appointment Location',
'Comments',
'Patient Room Phone',
'Phone',
'Payor',
'MRN Type'
],
colModel: [
{ name: 'Edit', width: 95, align: 'left' },
{ name: 'MRN', width: 125, align: 'left' },
{ name: 'Hospital_Fin', width: 145, align: 'left' },
{ name: 'First_Name', width: 115, align: 'left' },
{ name: 'Last_Name', width: 115, align: 'left' },
{ name: 'Date_of_birth', width: 145, align: 'left' },
{ name: 'Completed_Pathway', width: 125, align: 'left', editOptions: {value:"1:Yes;0:No"} },
{ name: 'Completed_Pathway_Reason', width: 165, align: 'left' },
{ name: 'PCP_Appointment', width: 115, align: 'left' },
{ name: 'Specialist_Appointment', width: 125, align: 'left' },
{ name: 'Admit_Date', width: 185, align: 'left' },
{ name: 'Discharge_Date', width: 185, align: 'left' },
{ name: 'Discharge_Disposition', width: 155, align: 'left' },
{ name: 'Discharge_To', width: 85, align: 'left' },
{ name: 'Discharge_Advocate_Call', width: 155, align: 'left' },
{ name: 'Home_Health_Care_Accepted', width: 105, align: 'left' },
{ name: 'Safe_Landing_Accepted', width: 165, align: 'left' },
{ name: 'PCP_Name', width: 85, align: 'left' },
{ name: 'PCP_Phone', width: 85, align: 'left' }, // formatter: formatPhoneNumber,
{ name: 'PCP_Appointment_Location', width: 185, align: 'left' },
{ name: 'Specialist_Name', width: 195, align: 'left' },
{ name: 'Specialist_Phone', width: 135, align: 'left' }, //, formatter: formatPhoneNumber
{ name: 'Specialist_Appointment_Location', width: 185, align: 'left' },
{ name: 'Comments', width: 185, align: 'left' },
{ name: 'Patient_Room_Phone', width: 135, align: 'left' }, //, formatter: formatPhoneNumber
{ name: 'Phone', width: 125, align: 'left' }, //, formatter: formatPhoneNumber
{ name: 'Payor', width: 155, align: 'left' },
{ name: 'MRN_Type', width: 135, align: 'left' }
]
});
There are indeed several nulls in my database that come back... Not sure why this doesn't work...
Currently trying a UIHint...
#if (Model == null){
<text></text>
}else{
<text></text>
}
except now everything is being displayed incorrectly
Ok... I know what I was doing wrong. In my repository layer, I forgot I had a method that would take the string dates that were being pulled pack, parsed, and if the value was null I would set the minimum date.
I have now changed that so that it returns a null, or a parsed date...
public static DateTime? ValueOrMin(string value)
{
if (string.IsNullOrWhiteSpace(value)) return null;
return DateTime.Parse(value);
}
Thanks.
How can I have the table in this example indented, I would like to have white space on the side of the 2 rows and the header, basically I'd like a white margin on the left of everything below "Stackoverflow example".
It would be great if I could do it only with css.
Here is the code:
var data = [[48803, "DSK1", "", "02200220", "OPEN"], [48769, "APPR", "", "77733337", "ENTERED"]];
$("#grid").jqGrid({
datatype: "local",
height: 250,
colNames: ['Inv No', 'Thingy', 'Blank', 'Number', 'Status'],
colModel: [{
name: 'id',
index: 'id',
width: 60,
sorttype: "int"},
{
name: 'thingy',
index: 'thingy',
width: 90,
sorttype: "date"},
{
name: 'blank',
index: 'blank',
width: 30},
{
name: 'number',
index: 'number',
width: 80,
sorttype: "float"},
{
name: 'status',
index: 'status',
width: 80,
sorttype: "float"}
],
caption: "Stack Overflow Example",
// ondblClickRow: function(rowid,iRow,iCol,e){alert('double clicked');}
});
var names = ["id", "thingy", "blank", "number", "status"];
var mydata = [];
for (var i = 0; i < data.length; i++) {
mydata[i] = {};
for (var j = 0; j < data[i].length; j++) {
mydata[i][names[j]] = data[i][j];
}
}
for (var i = 0; i <= mydata.length; i++) {
$("#grid").jqGrid('addRowData', i + 1, mydata[i]);
}
/*
$("#grid").jqGrid('setGridParam', {onSelectRow: function(rowid,iRow,iCol,e){alert('row clicked');}});
*/
$("#grid").jqGrid('setGridParam', {ondblClickRow: function(rowid,iRow,iCol,e){alert('double clicked');}});
Here's a CSS-only solution. There is still a challenge for you when resizing columns. As you click and drag to resize, the vertical marker still shows at the original offset.
#gbox_grid, .ui-jqgrid .ui-jqgrid-titlebar {
padding-right: 20px;
}
.ui-jqgrid .ui-jqgrid-hdiv, .ui-jqgrid .ui-jqgrid-bdiv {
margin-left: 20px;
}
.ui-jqgrid .ui-jqgrid-titlebar {
margin-right: -20px;
}
.ui-jqgrid tr.jqgrow td:first-child {
border-left-style: solid;
border-left-color: inherit;
}
http://jsfiddle.net/meharg/8BkMw/4/
Because this is loaded after the CSS is parsed it will be hard to do it without a little JS if you are picky about the position of your script and style, here is what works without you needing to worrie about anything. Although i don't think it will work regardless of the style and script position if you want only a CSS solution as the table is generated after it gets parsed anyway.
http://jsfiddle.net/yNw3C/1534/embedded/result/
I added some comments where i added the code.
Edit, forgot to add the editable fiddle: http://jsfiddle.net/yNw3C/1539/