Is it possible to use includes in Java for Google Maps like you can in PHP? Currently, I have code that assigns colors to polygons.
var lineColor = {
"Tornado Warning": "#FF0000",
"Severe Thunderstorm Warning": "#FFFF33",
"Flash Flood Warning": "#00FF00",
};
As the list grows longer, I want to avoid cluttering the main code. Can I store this color assignment in a separate file and call it instead? Here's what I have tried:
// Assign colors to alerts
var lineColor = 'xml/alertColors.html';
I created an HTML file with the colors listed as follows:
<html>
<script type="text/javascript">
{
"Tornado Warning": "#FF0000",
"Severe Thunderstorm Warning": "#FFFF33",
"Flash Flood Warning": "#00FF00",
"Flood Advisory": "#00FF7F",
"Special Weather Statement": "#00FFFF",
};
</script>
</html>
It doesn't seem to be working. Am I doing something wrong or is including files in JavaScript not the same as in PHP?
-Thanks