All Projects → eperedo → vue-static-map

eperedo / vue-static-map

Licence: other
a simple component to generate an static google map

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-static-map

flutter google maps
A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
Stars: ✭ 86 (+258.33%)
Mutual labels:  map, google-maps
Flask Googlemaps
Easy way to add GoogleMaps to Flask applications. maintainer: @RiverFount
Stars: ✭ 550 (+2191.67%)
Mutual labels:  map, google-maps
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+11095.83%)
Mutual labels:  map, google-maps
Pizza Delivery
university project : Android pizza delivery app
Stars: ✭ 32 (+33.33%)
Mutual labels:  map, google-maps
Simplemap
A beautifully simple map field type for Craft CMS.
Stars: ✭ 136 (+466.67%)
Mutual labels:  map, google-maps
Gmapsfx
Java API for using Google Maps within a JavaFX application.
Stars: ✭ 233 (+870.83%)
Mutual labels:  map, google-maps
KotlinProject
This repo help for all developer who want to learn android or want to work on advance feature of android. This repo created with help of @awesomeui, @materialdesign and android latest feature. this repo contain major feature like : @awesome UI, @Material design, @firebase (auth, realtime database, firestore, push notification), @database (Room d…
Stars: ✭ 40 (+66.67%)
Mutual labels:  map, google-maps
Bikedeboa
A (Progressive) Web App to find, map and review bike parkings in the cities of Brazil.
Stars: ✭ 54 (+125%)
Mutual labels:  map, google-maps
Placepicker
Free Android Map Place Picker alternative using Geocoder instead of Google APIs
Stars: ✭ 126 (+425%)
Mutual labels:  map, google-maps
Airmapview
A view abstraction to provide a map user interface with various underlying map providers
Stars: ✭ 1,824 (+7500%)
Mutual labels:  map, google-maps
jk64-plugin-reportmap
Report Google Map APEX Plugin
Stars: ✭ 37 (+54.17%)
Mutual labels:  map, google-maps
Hajk
A modern, full-featured OpenLayers based map viewer and editor
Stars: ✭ 65 (+170.83%)
Mutual labels:  map
TomScottMap
A unofficial map of the videos created by Tom Scott. See his Youtube channel for the complete list of videos (including those that are not geo-referenceable).
Stars: ✭ 30 (+25%)
Mutual labels:  map
gpedal
Virtually ride indoors with Google Street View and bluetooth bike power meters (Web Bluetooth API)
Stars: ✭ 83 (+245.83%)
Mutual labels:  google-maps
php-sorted-collections
Sorted Collections for PHP
Stars: ✭ 22 (-8.33%)
Mutual labels:  map
leaflet.minichart
Leaflet.minichart is a leaflet plugin for adding to a leaflet map small animated charts
Stars: ✭ 27 (+12.5%)
Mutual labels:  map
chowist
Great places are chosen by great chowists
Stars: ✭ 13 (-45.83%)
Mutual labels:  google-maps
leaflet-tag-filter-button
Adds tag filter control for layers (marker, geojson features etc.) to LeafLet.
Stars: ✭ 48 (+100%)
Mutual labels:  map
GoogleMap Demo
GoogleMap一些常用API总结库
Stars: ✭ 24 (+0%)
Mutual labels:  map
vue-map-chart
VueJS map chart component
Stars: ✭ 27 (+12.5%)
Mutual labels:  map

vue-static-map

a simple component to generate an static google map

static google map

Google Documentation

Demo

Requirements

  1. Vue 2.X.X

Usage

  1. Install from npm

    npm install vue-static-map
    

    Or include in your html using the script tag

    <script src="https://unpkg.com/vue-static-map/dist/StaticMap.umd.min.js"></script>
  2. Add component in your app

    import StaticMap from 'vue-static-map';
    // or require('vue-static-map')
    // or window.StaticMap if you are including in a script tag
    
    export default {
    	components: {
    		StaticMap,
    	},
    };
  3. Create some parameters in your data object

    export default {
    	data: {
    		apiKey: 'YOUR_GOOGLE_API_KEY', // required
    		zoom: 13, // required
    		center: 'Brooklyn+Bridge,New+York,NY',
    		format: 'gif',
    		language: 'ja',
    		markers: [
    			{
    				label: 'B',
    				color: 'blue',
    				lat: 40.702147,
    				lng: -74.015794,
    				size: 'normal',
    			},
    			{
    				label: 'Y',
    				color: 'yellow',
    				lat: 40.711614,
    				lng: -74.012318,
    				size: 'tiny',
    			},
    			{
    				label: 'G',
    				color: 'green',
    				lat: 40.718217,
    				lng: -74.015794,
    				size: 'small',
    				icon: 'http://www.airsoftmap.net/images/pin_map.png',
    			},
    		],
    		paths: [
    			{
    				color: 'blue',
    				weight: 8,
    				geodesic: false,
    				fillcolor: '0xFFFF0033',
    				locations: [
    					{ startLat: 40.737102, endLng: -73.990318 },
    					{ startLat: 40.749825, endLng: -73.987963 },
    					{ startLat: 40.752946, endLng: -73.987384 },
    					{ startLat: 40.762946, endLng: -73.997399 },
    				],
    			},
    		],
    		type: 'roadmap',
    		size: [800, 400],
    	},
    	components: {
    		StaticMap,
    	},
    };
  4. In your template just call the static map component

    <static-map :google-api-key="apiKey" :format="format" :markers="markers" :zoom="zoom" :center="center" :size="size" :type="type" :paths="paths" :language="language"></static-map>

Events

  1. What about if you want the URL of the map, you can easily do that using the getUrl event

    function getUrl(url) {
    	this.url = url;
    }
    
    export default {
    	data: () => {
    		const dataValues = {
    			apiKey: 'YOUR_API_KEY',
    			center: 'Empire State Building',
    			url: '',
    			zoom: 13,
    		};
    		return dataValues;
    	},
    	name: 'app',
    	components: {
    		StaticMap,
    	},
    	methods: {
    		getUrl,
    	},
    };
  2. Add the event on your template

    <static-map :google-api-key="apiKey" v-on:get-url="getUrl" :zoom="zoom" :center="center"></static-map>

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run serve

# build for production with minification
npm run component
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].