OSMBuildings
OSMBuildings copied to clipboard
change the building colors
Hello, i want to change the colors of those 13 buildings to red and i don't how. and also i want to change the highlight color from black to another color.
Hi, Please provide an example what you've tried so far. General idea: you need affected building ids and then apply a filter.
Hello, thanks for replying I just don’t know what is the function to get the building by id and change its color to another I just need the general formula
On Sep 10, 2020, at 9:26 PM, Jan Marsch [email protected] wrote:
Hi, Please provide an example what you've tried so far. General idea: you need affected building ids and then apply a filter.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/OSMBuildings/OSMBuildings/issues/214#issuecomment-690660728, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANVQLQM3TVFNFJXRWWUQFVTSFER7RANCNFSM4RFCYISA.
Hello, thanks for replying I just don’t know what is the function to get the building by id and change its color to another I just need the general formula
This is how it works:
const map = new OSMBuildings({...});
const featureIdList = [...];
// walks through all features and if id hits your list, return a selection color
map.highlight(feature => {
if (featureIdList.indexOf(feature.id) > -1) {
return '#ffcc00';
}
});
To identify buildings, you need to know their id's. You'll find these by clicking buildings on https://osmbuildings.org
I hope it helps.
Hello,
i tried the below code and i have recieved the following error.
TypeError: map.highlight is not a function index.html:133:11
Regards, Abdelrahman
From: Jan Marsch [email protected] Sent: Saturday, September 19, 2020 9:06 PM To: OSMBuildings/OSMBuildings [email protected] Cc: amoustafa93 [email protected]; Manual [email protected] Subject: Re: [OSMBuildings/OSMBuildings] change the building colors (#214)
This is how it works:
const map = new OSMBuildings({...});
const featureIdList = [...];
// walks through all features and if id hits your list, return a selection color map.highlight(feature => { if (featureIdList.indexOf(feature.id) > -1) { return '#ffcc00'; } });
To identify buildings, you need to know their id's. You'll find these by clicking buildings on https://osmbuildings.org
I hope it helps.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/OSMBuildings/OSMBuildings/issues/214#issuecomment-695345438, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANVQLQKMETFPM5QE4CZ3DD3SGT6LHANCNFSM4RFCYISA.