Home > front end >  Js modify gold map icon imagesize
Js modify gold map icon imagesize

Time:09-16

how to modify the annotation of image size
 & lt; ! Doctype html> 

<meta charset="utf-8" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="chrome=1" & gt;
<meta name="viewport" content="initial - scale=1.0, user - scalable=no, width=device - width" & gt;
<style type="text/CSS" & gt;
Body, HTML, # container {
height: 100%;
margin: 0px;
The font: 12 px Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', 'Microsoft elegant black, Arial;
}
The title {
margin: 0px;
color: white;
font-size: 14px;
Background - color: rgba (0155255,0.8);
line-height: 22px;
Padding: 0 px 0 0 0 px;
The font - weight: lighter;
Letter - spacing: 1 px;
}
. The content {
Padding: 4 px;
color: #666;
The line - height: 18 px;
}
. Amap - info - the content {
Padding: 0 0 2 px 0 px;
}
</style>
Custom marker


<body>

Var map=new AMap. The map (' container '{
ResizeEnable: true,
Zoom: 16,
Center: [113.673192, 34.688124]
});
Var marker=new AMap. Marker ({
Map: the map,
The as/01. Ico icon: ", "
//points marked on the map shows the location of the
Size: new AMap. Size (128128),//icon size
ImageSize: new AMap. Size (25, 25),
Position: [113.673192, 34.688124],
Offset: new AMap. Pixel (-, 12-12)
});
//for displaying a map Marker set target, took the null when the parameter value, remove the Marker on the map: setMap (null)
Marker. SetMap (map);
//set covering shape to round
Var circle=new AMap. Circle ({
//set up center location
Center: [113.673192, 34.688124],
//set the radius of the circle
Redius: 100,
//set the circular fill transparency
FillOpacity: 0.1,
//circular fill color
FillColor: '# 09 f',
//set the color lines
StrokeColor: '# 09 f',
//contour line width
StrokeWeight: 1
})
//will round expansion disc is loaded into the map
Circle. SetMap (map);
//add mulch distribution, according to the map automatically zoom to the appropriate level of vision
Map. SetFitView ()
Var info=new AMap. InfoWindow ({
//to display the contents of the
Content: '& lt; Div & gt; Wang shuai peng & lt;/div>
'the mo, white young head, empty grievous & lt; br/> '
//equivalent basis point offset
Offset: new AMap. Pixel (0 to 28),
//information form size
Size: new AMap. Size (200, 0)
})
//open the location on the map information form
The info. The open (the map marker. GetPosition ())
</script>

CodePudding user response:

the original image size is 128 * 128

CodePudding user response:

# $(" img "). The CSS (" width ", "1280 px");

CodePudding user response:

added to where?

CodePudding user response:

reference 1st floor qq_29027865 response:
the original image size is 128 * 128

It is as you say,
Var marker=new AMap. Marker ({
Map: the map,
The as/01. Ico icon: ", "
//points marked on the map shows the location of the
Size: new AMap. Size (128128),//icon size
ImageSize: new AMap. Size (25, 25),
Position: [113.673192, 34.688124],
Offset: new AMap. Pixel (-, 12-12)
});

This part?

CodePudding user response:

Yeah yeah, right!

CodePudding user response:

reference 5 floor qq_29027865 reply:
yeah yeah, right!

Would you like the following quote others to see you reply message, otherwise people don't know you reply,
Just add on an event, such as:
This is a button, the button has an onclick event (click events)
Js code:
The function the click () {
# $(" img "). The CSS (" width ", "1280 px"); #//$(" img ") is through the id for the control of the picture, the CSS is to change the control's style style, width or height
//(width and height of proportion change a can only increase), 1280 px is needed to expand to the pixel
}

CodePudding user response:

Inside the CSS to change
Icon: height: 128 px, wdith: 128 px
  • Related