For map-based applications built around Google Maps, although the default color scheme is generally preferred given most people’s familiarity with it, occasionally it may be necessary to customize a map for better viewing experiences. I recently ran into this issue while working on an app for displaying weather and geological databases. Unfortunately the multitude of colors in the default map style made it difficult to visualize colored data markers and polylines. As such for this blog post I’ve decided to share a quick and easy way to customize map styles in React applications using the react-google-maps
library.
While it’s generally preferred to keep data layers as shallow as possible, at some point when building APIs it may be necessary to include attributes spanning multiple relationships and levels. Unfortunately the default nesting for json
with active_model_serializers
in Rails
is only one layer. This blog post aims to address this issue by exploring a couple ways to serialize deeply nested associations.
For the React-Redux project I decided to build a data-viewing application by integrating several geolocation databases with Google Maps. Without going into detail, a Rails API backend is responsible for persisting and providing earthquake, hurricane, and volcano positions (i.e., latitude and longitude coordinates) on request. A React-Redux frontend handles the user interactivity as well as the display of all geolocations. Rather than provide a comprehensive overview of the app, this blog post focuses on the integration of Google Maps via the react-google-maps
library.
Variables in JavaScript (JS), like most programming languages, are storage containers that hold information for future referencing and/or modification. Such information can be any JS data type like numbers, strings, objects, etc. Given the significance of variables, this blog post serves to review several basic concepts including declarations, initializations, scope, and hoisting. These concepts are then discussed in regard to JS functions.
Given the requirement for utilizing JavaScript (JS) Model Objects in the rails app with a jQuery front end, I’ve decided to dedicate this post to reviewing the basics of objects and specifically how they’re created. In short, JS objects are standalone entities containing a collection of properties, i.e., key (property name) / value associations. The properties represent characteristics of the object and can be thought of as standard JS variables attached to the object. If the property happens to be a function, it is referred to as a method. Thus methods are simply functions that are associated with the object. All object properties including methods are accessed via the dot-notation as shown below. Lastly it should be noted that all unassigned properties of the object are undefined.
object.property