-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Maps für Einsatzorte #114
Open
jhbriese
wants to merge
13
commits into
abrain:develop
Choose a base branch
from
jhbriese:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4aa6001
Merge pull request #2 from abrain/develop
jhbriese 05ea58c
Einsatzorte können mittels Google Maps API dargestellt werden.
jhbriese b53409e
Fehlende Felder in den Tests ergänzt
jhbriese 1eae76f
GoogleMaps integration: Refactoring: JavaScript so weit es geht aus d…
jhbriese abff043
Merge pull request #3 from abrain/develop
jhbriese 43f3878
Merge branch 'develop' of github.com:abrain/einsatzverwaltung into de…
jhbriese 9e871c2
Aufräumen
jhbriese 1548271
Merge commit '5403d5d25c2bf188f4436827232fc8832dc3919e' into develop
jhbriese a4129e1
Einige Probleme nach merge (Fehlende Zeilen) behoben und Anregungen v…
jhbriese 7db9342
Merge branch 'develop' into develop
jhbriese dce2881
Code Climate improvements
jhbriese 1933af4
Typo in den Settings Googel --> Google
jhbriese 0c22b7d
Merge branch 'develop' of https://github.com/abrain/einsatzverwaltung…
jhbriese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
GoogleMaps integration: Refactoring: JavaScript so weit es geht aus d…
…em PHP Source entfernt und in js/einsatzverwaltung-gmaps.js ausgelagert. [einsatzliste] um Parameter googlemaps=ja/nein erweitert, um am Seitenanfang eine Karte mit allen Einsätzen anzuzeigen.
- Loading branch information
commit 1eae76f161761e2ac15d99b1a040b0ffa49d54bd
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
var map; | ||
var marker | ||
|
||
function initializeMap(lat, lon, zoom) { | ||
if(!zoom) { | ||
zoom = 13; | ||
} | ||
var latLon = new google.maps.LatLng(lat, lon); | ||
var mapOptions = { | ||
zoom: zoom, | ||
center: latLon | ||
}; | ||
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); | ||
} | ||
|
||
function setAdminMarker( position, locationField ) { | ||
if (marker && marker.setPosition) { | ||
// if the marker already exists, move it (set its position) | ||
marker.setPosition(position); | ||
} else { | ||
marker = new google.maps.Marker({ | ||
map: map, | ||
position: position, | ||
draggable: true, | ||
scaleControl:true | ||
}); | ||
} | ||
map.setCenter(marker.getPosition()); | ||
document.getElementById(locationField).value=marker.getPosition().toUrlValue(); | ||
marker.addListener("drag", function(){ | ||
document.getElementById(locationField).value=marker.getPosition().toUrlValue(); | ||
}); | ||
} | ||
|
||
function geocodeAddress( address, locationField ) { | ||
var geocoder = new google.maps.Geocoder(); | ||
geocoder.geocode({"address": address}, function(results, status) { | ||
if (status === google.maps.GeocoderStatus.OK) { | ||
var location = results[0].geometry.location; | ||
setAdminMarker( location, locationField ); | ||
map.setZoom(16); | ||
} else { | ||
alert("Konnte Position nicht ermitteln: " + status); | ||
} | ||
}); | ||
} | ||
|
||
function addMarker( lat, lon , infoContent, showContent ) { | ||
var latLon = new google.maps.LatLng(lat, lon); | ||
var newMarker = new google.maps.Marker({ | ||
map: map, | ||
position: latLon, | ||
}); | ||
var infowindow = new google.maps.InfoWindow({ | ||
content: infoContent | ||
}); | ||
newMarker.addListener('click', function() { | ||
infowindow.open(map, newMarker); | ||
}); | ||
if(showContent) { | ||
infowindow.open(map, newMarker); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eine Methode (
isGMapActivate()
), die danktoBoolean()
immer einen Boolean zurückliefert, auf einen leeren String prüfen?