Git Product home page Git Product logo

gmaps's Introduction

gmaps

This repository will test several Google Maps APIs using a localhost static website development environment for plain HTML, CSS, and JavaScript files with live reload using webpack + webpack-dev-server.

Content

Dependencies

The following dependecies are used for this project. Feel free to experiment using other dependencies and versions.

  1. Windows 64-bit OS
  2. NodeJS
    • node version 18.14.2
    • npm version 9.5.0
  3. NodeJS webpack modules (installed via npm)
    • webpack 5.64.2
    • webpack-dev-server 4.5.0
    • webpack-cli 4.9.1
    • css-loader 6.5.1
    • style-loader 3.3.1

Installation

  1. Clone this repository. https://github.com/weaponsforge/gmaps.git

  2. Install dependencies. npm install

  3. Create a .env file from the .env.example file. Update the variables in the .env file as needed.

    Variable Name Desccription
    APP_NAME Application name
    MAP_LAT Latitude
    MAP_LON Longitude
    MAP_ZOOM_INIT Web map's initial zoom (0 - 21)
    MAP_ZOOM_MAX Web map's maximum zoom (0 - 21)
    MAP_BASEMAP_URL Base map URL
    MAP_BASEMAP_ATTRIB Bas map attribution text
    MAPBOX_ACCESS_TOKEN MapBox access token.
    Provide a "LeafletMapBox.accessToken" constructor parameter in the LeafletMapBox class if this variable has no value.
    MAPBOX_STYLE_URL MapBox style URL (basemap style)
    GOOGLE_API_KEY Google Maps API key
  4. Checkout a branch that tests specific Google Maps related items:

    • dev
      • Full screen LeafletJS web map demo.
      • git checkout dev
    • feature/weaponsforge-10
      • Experiments in listing all home addresses inside a circle radius, Issue #10
      • git checkout feature/weaponsforge-10
    • feature/weaponsforge-11
      • Experiments in capturing a screenshot from a 3D (tilted) Google Map, Issue #11
      • git checkout feature/weaponsforge-11
    • feature/weaponsforge-22
      • Experiments drawing shapes on a 2D/3D (tilted) Google Map, Issue #22
      • git checkout feature/weaponsforge-22
    • feature/weaponsforge-25
      • Experiments comparing different types of base maps (MapBox satellite, 2D Google Map, 3D Google Map), Issue #25
      • git checkout feature/weaponsforge-25
    • feature/weaponsforge-35
      • Experiments testing precicion Leaflet.draw Polygon Pins (vertex) placements, Issue #35
      • git checkout feature/weaponsforge-35

Usage

  1. Run the localhost static website development environment.
    npm run dev

  2. Edit the existing static files from the ./src directory and wait for live reload. Your updates will reflect on the web browser.

  3. To include new static website files on live reload:

    • Stop the localhost dev server.
    • Create new static (.js, .css) files inside the ./src directory.
      • Import the new .js and .css files in ./src/index.js
      • Javascript events may need to be attached to Html DOM elements using .addEventListener() if you are only using raw Html files.
      • New Html files need to be encoded inside new HtmlWebpackPlugin({ ... }) in webpack.config.js
      • Specific specific file types other than CSS and image files may need to have their node module dependency installed and included in webpack.config.js's module -> rules part.
    • Re-start the dev server.
      npm run dev
  4. Build the project for production environment. Built static files are placed in the /dist directory.
    npm run build

  5. Run the production static website (does not use live reload).
    npm run start

References

[1] - live reload using gulp + browser-sync (demo)
[2] - webpack notes (trello)

@weaponsforge
20230911

gmaps's People

Contributors

weaponsforge avatar

Stargazers

 avatar

Watchers

 avatar

gmaps's Issues

Create a maps demo page for visual comparison

Goal

The goal of this ticket is to test and assess which of the MapBox satellite-v9, 2D Google Map and 3D Google Map will provide the best-looking map tiles on high web map zoom factors while considering the checklist:

  • Able to take map screenshot
  • Able to draw shapes on the map (Circle, Polygon)
  • Accurate measurements of rooftops
  • Able to fetch home addresses within a Circle drawn in the Map

The maps demo page should feature (3) kinds of maps for visual comparison:

  1. 2D web map - using the MapBox satellite-v9 base map
    • Use the libraries: LeafletJS, MapBox GL JS and Leaflet-MapBox-GL (LeafletJS plugin for MapBox) to render the map
  2. 2D web map - using the Google Maps satellite base map
    • Use the libraries: LeafletJS and GoogleMutatant (LeafletJS plugin) to render the map
    • To confirm: Why do some locations look "3D" even if the we're using the 2D version
  3. 3D web map - using the "tilted", "rotatable" Google Maps satellite base map
    • Use the library: Google Maps API to render the map

Other Features

  1. Search by address feature
    • all maps should zoom into the selected address location for easy testing

Other Features

  1. Enable screenshot on each map
  2. Enable Circle and polygon shape drawing on each map
  3. Confirm accurate line measurements on each map

Blurry Maps Findings

[ o ] - okay
[ x ] - not applicable
[ โˆž ] - on-going testing
[ - ] - untested

Checklist 2D Mapbox
(currently used by list via map page)
2D Google Map
(currently used by request measurement page)
3D Google Map
(experimental)
clear map tiles on high zoom levels - o/x
- blurry tiles in some areas specially remote areas
- o/x
- clearer tiles on high zoom levels than MapBox
- some places look blurry
- o/x
-sharper-looking tiles in some angles than the 2D Google Map
-other places look blurry
-some locations do not have a 3D version
screenshot o o o
draw circle o o o
draw polygon o o o
accurate measurements o o โˆž
can fetch home addresses o o o

Get a screenshot from google maps

Test getting a screenshot of a Google Maps area using (2) two methods:

Using Google Maps API

  • Display a google maps (satellite base map)
  • Take a screenshot of the current area displayed on the map

Using LeafletJS and the Google Mutant LeafletJS Plugin

  • Install and use the the Google Mutant leafletjs plugin to render a Google Maps satellite basemap inisde a Leaflet JS map
  • Take a screenshot of the current area displayed on the map

Test Leaflet.draw Polygon Pins for precision placements on mobile

Goals

  • Using Leaflet and the Leaflet.draw plugin, allow placing Polygon Pins with very small distance from each other on mobile and desktop web browsers
  • When placed too close to each other, the Pins should not automatically "close" the Polygon.

Test Using Other Leaflet Plugins

References

Test Leaflet components for overrides:

v1.1.1

  • Execute callbacks for certain shape types in the MapDraw class bindMapEvents() method

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.