2

I am using http://jsfiddle.net/xSPAA/371/

//Add the requried module 'angular-ui' as a dependency
angular.module('maptesting', ['ui.map','ui.event']);

function MapCtrl($scope) {
    var ll = new google.maps.LatLng(45, -73);
    $scope.mapOptions = {
        center: ll,
        zoom: 8,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    //Markers should be added after map is loaded
    $scope.onMapIdle = function() {
        if ($scope.myMarkers === undefined){    
            var marker = new google.maps.Marker({
                map: $scope.myMap,
                position: ll
            });
            $scope.myMarkers = [marker, ];
        }
    };

    $scope.markerClicked = function(m) {
        window.alert("clicked");
    };

}

plunker to show google map. I need to show a specific location map that a user will enter into a text box.

How can I do it?

Do I need to use Geo Location API?

Can any one give sample code or plunker?

1 Answer 1

3

Below is the working example :

http://www.victorshi.com/blog/post/Use-Geolocation-API-with-Angularjs

Example

Also check below url:

http://www.benfarrell.com/2013/11/05/some-geolocation-and-google-mapping-services-in-angularjs/

Google Location Service

http://jsfiddle.net/mrajcok/pEq6X/

directive 'googlePlaces'
Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.