BSBMaterial added
This commit is contained in:
98
app/assets/javascripts/BSBMaterial/pages/maps/google.js
Normal file
98
app/assets/javascripts/BSBMaterial/pages/maps/google.js
Normal file
@@ -0,0 +1,98 @@
|
||||
$(function () {
|
||||
//Basic Map
|
||||
var basicMap = new GMaps({
|
||||
el: '#gmap_basic_example',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
|
||||
//Markers
|
||||
var markers = new GMaps({
|
||||
div: '#gmap_markers',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
markers.addMarker({
|
||||
lat: -12.043333,
|
||||
lng: -77.03,
|
||||
title: 'Lima',
|
||||
details: {
|
||||
database_id: 42,
|
||||
author: 'HPNeo'
|
||||
},
|
||||
click: function (e) {
|
||||
if (console.log)
|
||||
console.log(e);
|
||||
alert('You clicked in this marker');
|
||||
}
|
||||
});
|
||||
markers.addMarker({
|
||||
lat: -12.042,
|
||||
lng: -77.028333,
|
||||
title: 'Marker with InfoWindow',
|
||||
infoWindow: {
|
||||
content: '<p>HTML Content</p>'
|
||||
}
|
||||
});
|
||||
|
||||
//Static maps
|
||||
var staticMap = GMaps.staticMapURL({
|
||||
size: [$('#gmap_static_map').width(), 400],
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
|
||||
$('<img/>').attr('src', staticMap).appendTo('#gmap_static_map');
|
||||
|
||||
//Static maps with markers
|
||||
var staticMapWithMarkers = GMaps.staticMapURL({
|
||||
size: [$('#gmap_static_map_with_markers').width(), 400],
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
markers: [
|
||||
{ lat: -12.043333, lng: -77.028333 },
|
||||
{
|
||||
lat: -12.045333, lng: -77.034,
|
||||
size: 'small'
|
||||
},
|
||||
{
|
||||
lat: -12.045633, lng: -77.022,
|
||||
color: 'blue'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('<img/>').attr('src', staticMapWithMarkers).appendTo('#gmap_static_map_with_markers');
|
||||
|
||||
//Static maps with polyline
|
||||
var path = [
|
||||
[-12.040397656836609, -77.03373871559225],
|
||||
[-12.040248585302038, -77.03993927003302],
|
||||
[-12.050047116528843, -77.02448169303511],
|
||||
[-12.044804866577001, -77.02154422636042],
|
||||
[-12.040397656836609, -77.03373871559225],
|
||||
];
|
||||
|
||||
var staticMapPolyline = GMaps.staticMapURL({
|
||||
size: [$('#gmap_static_map_polyline').width(), 400],
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
|
||||
polyline: {
|
||||
path: path,
|
||||
strokeColor: '#131540',
|
||||
strokeOpacity: 0.6,
|
||||
strokeWeight: 6
|
||||
// fillColor: '#ffaf2ecc'
|
||||
}
|
||||
});
|
||||
|
||||
$('<img/>').attr('src', staticMapPolyline).appendTo('#gmap_static_map_polyline');
|
||||
|
||||
//Panorama
|
||||
var panorama = GMaps.createPanorama({
|
||||
el: '#gmap_panorama',
|
||||
lat: 42.3455,
|
||||
lng: -71.0983
|
||||
});
|
||||
});
|
||||
51
app/assets/javascripts/BSBMaterial/pages/maps/jvectormap.js
Normal file
51
app/assets/javascripts/BSBMaterial/pages/maps/jvectormap.js
Normal file
@@ -0,0 +1,51 @@
|
||||
$(function () {
|
||||
$('#world-map-markers').vectorMap({
|
||||
map: 'world_mill_en',
|
||||
normalizeFunction: 'polynomial',
|
||||
hoverOpacity: 0.7,
|
||||
hoverColor: false,
|
||||
backgroundColor: 'transparent',
|
||||
regionStyle: {
|
||||
initial: {
|
||||
fill: 'rgba(210, 214, 222, 1)',
|
||||
"fill-opacity": 1,
|
||||
stroke: 'none',
|
||||
"stroke-width": 0,
|
||||
"stroke-opacity": 1
|
||||
},
|
||||
hover: {
|
||||
"fill-opacity": 0.7,
|
||||
cursor: 'pointer'
|
||||
},
|
||||
selected: {
|
||||
fill: 'yellow'
|
||||
},
|
||||
selectedHover: {}
|
||||
},
|
||||
markerStyle: {
|
||||
initial: {
|
||||
fill: '#009688',
|
||||
stroke: '#000'
|
||||
}
|
||||
},
|
||||
markers: [
|
||||
{ latLng: [41.90, 12.45], name: 'Vatican City' },
|
||||
{ latLng: [43.73, 7.41], name: 'Monaco' },
|
||||
{ latLng: [-0.52, 166.93], name: 'Nauru' },
|
||||
{ latLng: [-8.51, 179.21], name: 'Tuvalu' },
|
||||
{ latLng: [43.93, 12.46], name: 'San Marino' },
|
||||
{ latLng: [47.14, 9.52], name: 'Liechtenstein' },
|
||||
{ latLng: [7.11, 171.06], name: 'Marshall Islands' },
|
||||
{ latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis' },
|
||||
{ latLng: [3.2, 73.22], name: 'Maldives' },
|
||||
{ latLng: [35.88, 14.5], name: 'Malta' },
|
||||
{ latLng: [12.05, -61.75], name: 'Grenada' },
|
||||
{ latLng: [13.16, -61.23], name: 'Saint Vincent and the Grenadines' },
|
||||
{ latLng: [13.16, -59.55], name: 'Barbados' },
|
||||
{ latLng: [17.11, -61.85], name: 'Antigua and Barbuda' },
|
||||
{ latLng: [-4.61, 55.45], name: 'Seychelles' },
|
||||
{ latLng: [7.35, 134.46], name: 'Palau' },
|
||||
{ latLng: [42.5, 1.51], name: 'Andorra' }
|
||||
]
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user