Questions tagged [plugin-smartmap]
The plugin-smartmap tag has no usage guidance.
53
questions
5
votes
1
answer
402
views
How do I talk to Smart Map in JavaScript?
Well, I know for a fact I am doing this incorrectly & it's going to be painfully obvious. I can see why (I think) but to be honest I just don’t “get it”.
I’m trying to style a Google map using ...
4
votes
2
answers
704
views
Filter locations by country in Smart Map
I'm using Smart Map to find locations ordered by distance. But I can only set 3 parameters: target, range and units. However, when my range goes beyond the country borders I obviously get results in ...
4
votes
2
answers
2k
views
How do you auto zoom/center Smart Map with multiple markers?
How can I auto center and zoom my Smart Map with multiple markers?
Something like this:
var bounds = new smartMap.map.LatLngBounds();
smartMap.map.fitBounds(bounds);
4
votes
1
answer
298
views
Smart Map cluster marker
I use Smart Map for a project, but I have a question for this plugin.
Is it possible group the markers per cluster or I need see other options.
Tks
4
votes
1
answer
690
views
Modify ElementCriteria and use it for paginate
First some context. I'm using Smart Map for Craft to display some location based events in a listing. My structure is as follows:
Events channel
Locations channel
Each event can occur multiple times,...
4
votes
1
answer
205
views
How do I filter by multiple Smart Map addresses?
I have profiles (Users) that can have multiple addresses (currently two Smart Map fields called profileAddress1 and profileAddress2).
I know how to filter by a single address:
{% set results = craft....
4
votes
1
answer
272
views
Smart Map - Setting single map with multiple pins
I have a Smart Map field in a section and am trying to output multiple results (pins) to a single map.
This code will output multiple maps (one map per pin)
{% for mapEntry in craft.entries.section('...
4
votes
1
answer
151
views
Smart Map plugin - Get visitor's lat/lng
I'm using the Smart Map plugin but want to render my own maps. All I need is the lat/lng of a visitor yet I can't find it in the documentation. I don't want Smart Maps to render the map for me, I just ...
3
votes
1
answer
420
views
How to programmatically set a Smart Map address field in plugin
I have a console command plugin that needs to periodically go and fetch property data via API and import it into Craft. I can pull in basic property information but when it comes to importing the data ...
3
votes
2
answers
329
views
Smart Map - Sorting for closest location in PHP
I want to sort entries with a Smart Map address field for closest location. I know how it should be done in a template:
{% set entries = craft.entries.myAddress(params).order('distance').find() %}
...
3
votes
1
answer
219
views
Setting the position of a Smart Map marker on the front end
I'm using Smart Map in a front end entry form and trying to set the position of a marker as the user enters their address.
I can get the lat/lon lookup working but I'm stumped with the marker itself.
...
3
votes
1
answer
253
views
How do you set a different icon per entry in SmartMap?
And how do you set a different icon and infoWindow when a lightswitch or entry type?
{% set locations = craft.entries.section('section').find() %}
{% set options = {
'zoom': 5,
'height': 750,...
3
votes
1
answer
209
views
Smart Map - pass options into markers individually
I have successfully got Smart Map up & running and now want to tailor it for my own purposes.
I will have hundreds of markers for businesses, which I am categorising via fields in Craft. What I ...
3
votes
1
answer
105
views
Filtering/Searching fields with enumerated data (e.g. Smart Map) in an ElementCriteria model
I have an ElementCriteriaModel in which I need to find elements that contain a particular value for "state", which is a property of a "Smart Map" field ($element->smartMapField->state).
...
2
votes
2
answers
691
views
Adding markers to map from field in entries within section
I feel like I'm overlooking something simple here, but I can't for the life of me figure out how to add markers to a map. I had this working with the Google Maps for Craft plugin but since switching ...
2
votes
2
answers
107
views
How can I add Google MarkerClusterer library to Smart Map?
I started to work with Craft CMS a couple month ago, I have a client that wants to have a clustered map, I went over Smart Map documentation but I couldn't find anything about on how to add Google ...
2
votes
1
answer
155
views
How do I differentiate between entries after merging an array?
I'm trying to plot entries from two different Solspace Calendars and an Entries section on one map, and use different markers for all types. Alll of the events are related to the current Entry through ...
2
votes
2
answers
693
views
Why do the plugin resource paths include the localization prefix?
I'm using Craft in a multilingual setup with the Smart Map plugin. However, the CSS and JavaScript files are not being linked properly when the site isn't in the main language.
For some reason, the ...
2
votes
1
answer
220
views
Getting unique values from Smart Map addresses
Using the following filter will return all the entries for 'CA'.
{% set params = {
filter: {
state: 'CA'
}
} %}
{% set meetings = craft.entries.address(params) %}
Let's say that I ...
2
votes
1
answer
60
views
FeedMe + Google Maps plugin Address fields missing
Just upgraded to GoogleMaps plugin (from SmartMap) and trying to replicate FeedMe feeds.
When I go to assign field -> feed element, I see
my regular entry field
I don't see the address sub fields, ...
2
votes
1
answer
33
views
Invalid KML file using Smart Map Plugin
I'm using Smart Map for Craft 3 to develop this filterable map for Columbia, Missouri. Here's the staging site:
http://visionzerodev.org/map-alpha/
This works brilliantly. Huzzah.
Now, I also need to ...
2
votes
1
answer
158
views
Set OrderBy on Grouped Query Involving Smart Map Field
I'm working with a Structure of resort locations. Each resort has a field address which is a Smart Map field. I'm trying to create an initial display page that groups the resorts based on their state (...
2
votes
1
answer
343
views
Smart Map - How to search by a field in address?
I have entries using the Smart Map address field. I need to get just the entries that have a combination of city and state (city = "Beverly Hills" AND state = "CA"). I am currently ...
2
votes
1
answer
139
views
Smart Map - setting an icon size
I'm trying to figure out how to set the size of a marker on a map.
{% set options = {
zoom: 6,
markerOptions: {
icon: 'https://www.mysite.com/images/map/marker.png',
scaledSize: 'new ...
2
votes
1
answer
237
views
Smart Map with linked SVG icons for markers
I have a smart map where I'm trying to use linked SVG files for the marker icons. In Safari, the files load at actual size, which in this case is fine, but in Chrome and Edge, they are scaled up, and ...
2
votes
1
answer
80
views
Smart Map - Output map locations from relationship file in a matrix
I have "locations" section where each entry is a location, with a Smart Map field for the address.
I have another section "pages", where I have a matrix field which contains an entry relationship ...
2
votes
1
answer
170
views
Smart Map - Outputting locations from a Matrix field for all entries within a single section
I'm using the Smart Map plugin, and I can't seem to figure out how to output all the locations of my entries from a single section onto one single map.
I think the issue I'm having is trying to get ...
2
votes
1
answer
59
views
Making the Smart Map field translatable
I have a multi-language site. So I need to show slightly different address data, depending on the current locale. Especially regarding the city and country field.
Example:
DE
Venloer Str. 200
Köln
...
2
votes
1
answer
187
views
How do I add styles or a theme to a Smart Map map?
It's probably a syntax issue, but how do I add this Google Map styling code:
[
{
"elementType": "geometry",
"stylers": [
{
"color": &...
2
votes
1
answer
244
views
Filter locations by zip in Smart Map
I am making a simple call to entries near a zip code using this url format:
example.com/locations-zip-ajax?near=93003
My template includes this code:
{% set target = craft.request.getParam('near') %...
2
votes
1
answer
262
views
SmartMap throwing back javascript error
On my _entry page, I'm trying to get the SmartMap plugin to generate a dynamic map, but it gets stuck on 'Loading Map'
Using this as the code:
{{ craft.smartMap.map(entry.theEventAddress) }}
and ...
2
votes
1
answer
97
views
How can I tell Smart Map to look at Commerce for entries?
I have Smart Map working perfectly within Commerce. Meaning, I am able to show a map, etc. when I'm looking at products.
However, I am trying to build a "product locator" to find products in my area.
...
2
votes
1
answer
530
views
Smart Map with multiple different markers based on a matrix field
I'm having some trouble setting different markers using the smart map plugin and was hoping someone might be able to point me in a direction I might not see.
The different locations are are set ...
2
votes
2
answers
241
views
Smart Map InfoBubble 'pointer' position
I am having issues with the Smart Map infoBubble pointer position...
As you see the shadow is positioned correctly, but the white overlay triangle is too low down. Or the other way of thinking about ...
2
votes
1
answer
229
views
Search Matrix and Smartmap
I'm trying to search through a set of results inside a Matrix field. Craft is giving me this error message: Craft\EntryModel and its behaviors do not have a method or closure named "avdelinger".
When ...
2
votes
1
answer
108
views
Grabbing the existing address data to use with Smart Map
I'm new to Craft CMS, so pardon me. I've been using the VZ Address plugin to handle all our address entries, and have a couple hundred of workshop address entries already.
I'm trying to use Smart Map ...
2
votes
0
answers
183
views
Smart Maps problems displaying static maps [closed]
I'm trying to output a static map from a smart map field in a matrix. I can output a dynamic map with no issues, but the static map code isn't working.
Here is my code:
{% set locations = entry....
2
votes
0
answers
97
views
How can I make a SmartMap field required on a user profile page?
I am using Craft 2.5 (Beta) along with the fantastic SmartMap plugin. I have a user registration page that I am using the SmartMap field with like this:
twig
...
<div class="form-group has-...
1
vote
2
answers
1k
views
How can I change the size of an individual pin?
I tried this code, but getting 'unexpected token errors". Probably something to do using incorrect syntax.
{% js %}
var markerId = 'smartmap-mapcanvas-1.{{ entry.id }}.addressInformation';
...
1
vote
1
answer
176
views
Nearest entry using related entry Smart Map field
I’m trying to build a query to get the geographically closest entries, based on an Smart Map field value within a related entry.
The following template tags were my first guess, but returned an empty ...
1
vote
1
answer
92
views
Google Maps plugin - How to trigger an info window
I'm migrating Smart Map over to the Google Maps plugin, and I want to open a popup on button click. But it seems there is no JS method available to open an info window.
Here's how it was done in Smart ...
1
vote
1
answer
110
views
Trigger Info window in Smart Map using external navigation
I would like to trigger an info window in Smart Map using a navigation that lives beside the map. I've managed to figure out how to use the zoomOnMarker function, however, the info window does not pop ...
1
vote
1
answer
85
views
Visitor array has empty values with Smart Map plugin (using MaxMind)
I'm receiving an array with empty values when trying to get visitor info using the Smart Map plugin and its Visitor Geolocation feature. I'm using MaxMind's free trial ($5 worth of queries) since ...
1
vote
1
answer
115
views
High amount of API calls from Smart Map
I have a Smart Map setup and installed it on a site.
The section averages 300 page views per day according to Google Analytics, but Google API is maxing out the 2500 requests on the free plan. I've ...
1
vote
1
answer
80
views
Smart Map Lat+Lng is present but no pin on map
My map isn't showing all of the markers that it should. I am querying a user group to return the locations as follows:
{% set locations = craft.users.group('fullMembership') %} {{ craft.smartMap.map(...
1
vote
1
answer
135
views
myFieldHandle error in Craft using Smart Map
I am getting a Twig runtime error on the below. The map and everything else works when I remove myFieldHandle(params).orderBy('distance').
Error:
Calling unknown method: craft\elements\db\EntryQuery::...
1
vote
1
answer
76
views
Advanced Search Filter
I am trying to complete an advanced search query with Smart Map, but I can't seem to quite get it. I tried to merge several URL parameters, and they seem to work fine except when it comes down to ...
1
vote
1
answer
170
views
Setting Google maps circles using Smart Map plugin
So, I'm trying to set circles around marker locations using Smart Map and some JS.
I've got the following which gives no errors, but outputs no circles.
$(function () {
$.each( smartMap.marker, ...
1
vote
2
answers
160
views
Using front end lookup for map display
I see the docs here about getting the lat/long of an address from a zip code, city, etc. I am having issues getting the map to render from this info. My code:
{% if craft.smartMap.visitor.ip != '' %}
...
1
vote
1
answer
97
views
Smart Map - Static map displays fine, dynamic map does not
I enabled the three API's at Google:
Google Maps JavaScript API
Google Maps Geocoding API
Google Static Maps API
I get a static map OK. All I get with the dynamic map is a "Loading Map..."....