Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Multiple Marker Color #66

Closed
monski opened this issue Oct 24, 2016 · 2 comments
Closed

Question: Multiple Marker Color #66

monski opened this issue Oct 24, 2016 · 2 comments

Comments

@monski
Copy link

monski commented Oct 24, 2016

Hello,

Just want to ask if i can change the marker on the defined position?
Sample: i want on the point 2, the marker will be the green, and the the rest is circle
<Gmaps ref="gmaps" params={{v: '3.exp', key: variables.gmapsApi}} width={'auto'} height={'600px'} lat={this.state.clickPoints.lat} lng={this.state.clickPoints.lng} onMapCreated={this.onMapCreated} zoom={this.state.gmapsZoom}> {this.state.pointsResult.length > 0 ? ( this.state.pointsResult.map((g,i) => { let icon = { path: google.maps.SymbolPath.CIRCLE, strokeColor: '#FF0000', fillColor: '#FF0000', fillOpacity: 0.8, scale: 5 } if(g.package_status ==null) { return ( <Marker icon={icon} onClick={() => this.toggleInfoWindow(i,g)} key={marker-${i}} lat={g.lat} lng={g.lng} /> ) } else { let colorIcon = "http://maps.google.com/mapfiles/ms/icons/green-dot.png" return ( <Marker icon={colorIcon} onClick={() => this.toggleInfoWindow(i,g)} key={marker-${i}} lat={g.lat} lng={g.lng} /> ) } }) ) : null } {this.state.pointsResult.length > 0 ? ( this.renderInfoWindows() ) : null } </Gmaps>

Thanks in advance.

@monski monski changed the title Question: Multiple Markers Question: Multiple Marker Color Oct 25, 2016
@MicheleBertoli
Copy link
Owner

MicheleBertoli commented Oct 25, 2016

Hello @monski,
not sure I understand your questions but the following demo should help:

screen shot 2016-10-25 at 19 30 09

source

Please let me know if you have any other questions.

@monski
Copy link
Author

monski commented Oct 27, 2016

Hello Michele,
thanks for the reply, i figured it out also that it needs two separate array of the position for that..
thanks again

@monski monski closed this as completed Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants