You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
monski
changed the title
Question: Multiple Markers
Question: Multiple Marker Color
Oct 25, 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.
The text was updated successfully, but these errors were encountered: