Comments (10)
hi, can you show us how you define the directive inside html? you should also bind center value on directive initilization
from angular-leaflet-directive.
Well, for whatever reason I can't insert the html. It doesn't show.
Basically I have a "leaflet" tag and markers="markers" plus center="center" in the opening tag statement.
from angular-leaflet-directive.
from angular-leaflet-directive.
have you defined the center property on controller initialization? also don't use extend to change the value in scope, assign a new value to it directly:
$scope.center.lat = item.latitude;
$scope.center.lng = item.longitude;
$scope.markers.store = {
lat: item.latitude,
lng: item.longitude,
message: "Drag me to your position",
focus: true,
};
from angular-leaflet-directive.
I guess I don't understand how this all fits together.
- Do I even need to pass the "item" variable to the extend function?
- Do I need to call $scope.addMarker? and if so, where would I call it... once on init?
from angular-leaflet-directive.
OK, I got it!!!
from angular-leaflet-directive.
nice!
In short, avoiding using extend unless you think you really understand how scope works in angular ;p
from angular-leaflet-directive.
@houqp Why are you guys using angular.extend()
in every example out there while you don't recommend it?
from angular-leaflet-directive.
Hm.. good point. I think It's because extend is handy for quick scope initialization. It does causes confusion for new angular users when they use it for scope update. But It's not a bad practice to use it. Once a user has a basic understanding of angular scope, he/she will be able to understand what is happening behind the scene :)
from angular-leaflet-directive.
@mikekay01 , can you please tell me how did you solve that problem. Beacause if i try to add markers in the way you did, not via function but in the beginning, leaflet doesnt add them. they ARE in map, but not displayed
from angular-leaflet-directive.
Related Issues (20)
- Is there any support for offline map ? HOT 2
- Tiles error on load in Electron HOT 1
- $scope.path not working when click
- Having issue with tiles which are not being displayed when I want to print my leaflet map
- Central leaflet marker always when map moves
- Cannot read property 'innerText' of undefined at updatePopup
- zoomDelta and zoomSnap are not supported
- Map Not getting refreshed after changing dynamic map profile
- what are you think about convert this repo to new angular (5)?
- How to add simple custom-control to map
- how to override angular-leaflet-directive popup close button
- "The page can't load Google maps correctly"
- the version for angular JS is limited ?? or I can do all ?? as if i were use leftlet.js ????
- Any known issues related to WorldCopyJump w/ Leaflet 1.3.4? HOT 1
- How to draw markers snap to road on map ?
- Unable to load ExtraMarker Plugin HOT 1
- Helpful tip on compiling popup templates
- I can not use some characters in markers
- markers with special characters like dot HOT 1
- Is it possible to GEOJSON open popup by GET param in the url?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-leaflet-directive.