Comments (3)
Highlighting it's the selected point is pretty easy, here's how I do it:
I have a bunch of sites (points on the map), each with an uuid
, and when I create my ShapeSource
I pass a different image to the selected one:
function featuresFromSites(sites, activeSite) {
const features = sites.map(site => {
return {
type: 'Feature',
id: site.uuid,
properties: {
image: site.uuid === activeSite ? 'marker-active' : 'marker-inactive',
uuid: site.uuid,
},
geometry: {
type: 'Point',
coordinates: [site.gps.lon, site.gps.lat],
},
};
});
return {
type: 'FeatureCollection',
features,
};
}
To highlight the one the user presses, you can put an onPress
handler on the shapeSource, which then lets you set which point has been touched (you can access feature properties through the callback).
I've never had to show a bubble above the point personally so I can't help you there, I don't know the proper way to do it if you want the overlay to "stick" to the map like pointannotation bubbles do.
from maps.
I'd say it's a very good idea to make it clear, especially given that I was about to start rewriting some stuff to replace the SymbolLayer by PointAnnotations. 😨
What I'm missing is a way to show a bubble over a selected symbol, or some way of highlighting that it's the "selected" point. How are you doing it?
from maps.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from maps.
Related Issues (20)
- Android: When user pitches the map (two finger swipe gesture), isGestureActive becomes false when pitch starts to change
- [Bug]: RNMBXModels.models.getter not implemented (Expo Project) HOT 6
- [Bug]: FillLayer not rendered on IOS HOT 2
- Cannot upload app to app store on iOS HOT 2
- [Bug]: Flyto not working on Android HOT 1
- 'addEventEmitters' overrides nothing HOT 2
- [Bug]: Crash when changing Annotations source state HOT 1
- [Bug]: iOS: Can only change pitch or heading via setCamera when centerCoordinate is specified
- [Bug]: Task :app:checkDebugDuplicateClasses FAILED HOT 4
- [Bug]: Crash when changing Annotations source state in iOS
- [Bug]: Map is not usable in a (horizontal) ScrollView on Android HOT 4
- Crash on latest version on iOS (getZoom) HOT 1
- [Bug]: Image marker as SymbolLayer in ShapeSource does not appear on long press event
- [Bug]: iOS PointAnnotation need to "longpress" before you can start dragging it on the map, on Android you can drag immediately after Press/Tap HOT 1
- [Bug]: queryRenderedFeaturesAtPoint is inconsistent when using onLongPress on MapView
- [Bug]: TypeScript style props exports not working properly HOT 3
- Support for iOS 12.4 with Mapbox Maps SDK v11 HOT 2
- [Bug]: Custom Styles on iOS HOT 1
- [Bug]: LocationPuck topImage inconsistent with iOS HOT 1
- [Bug]: marker views not propagating press events from their children HOT 1
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 maps.